Undefined constant "FILTER_FLAG_SCHEME_REQUIRED

We just upgraded to PHP 8.2.8 on our server. We’re running Omeka 3.1.1 and now we’re getting the following error. We have the latest version of Berlin installed and it’s set as our theme. Is there any way to fix this as it’s continuing to generate errors as we use the application.

[Fri Aug 25 10:19:19.868484 2023] [php:error] [pid 1576] [client 10.250.108.10:22620] PHP Fatal error: Uncaught Error: Undefined constant “FILTER_FLAG_SCHEME_REQUIRED” in …/omeka/application/libraries/Omeka/Navigation/Page/Uri.php:109\nStack trace:\n#0 …/omeka/application/libraries/Omeka/Navigation/Page/Uri.php(39): Omeka_Navigation_Page_Uri->_normalizeHref()\n#1 …/omeka/application/libraries/Omeka/Navigation.php(464): Omeka_Navigation_Page_Uri->setHref()\n#2 …/omeka/application/libraries/Omeka/Navigation.php(69): Omeka_Navigation->_normalizePageRecursive()\n#3 …/omeka/application/libraries/Zend/Navigation/Container.php(172): Omeka_Navigation->addPage()\n#4 …/omeka/application/libraries/Zend/Navigation/Container.php(187): Zend_Navigation_Container->addPages()\n#5 …/omeka/application/libraries/Omeka/Navigation.php(48): Zend_Navigation_Container->setPages()\n#6 …/omeka/application/libraries/globals.php(2822): Omeka_Navigation->loadAsOption()\n#7 …/omeka/themes/berlin/common/header.php(57): public_nav_main()\n#8 …/omeka/application/libraries/Omeka/View.php(114): include(‘/usr/local/htdo…’)\n#9 …/omeka/application/libraries/Zend/View/Abstract.php(889): Omeka_View->_run()\n#10 …/omeka/application/libraries/Zend/View/Helper/Partial.php(109): Zend_View_Abstract->render()\n#11 …/omeka/application/libraries/Zend/View/Abstract.php(350): Zend_View_Helper_Partial->partial()\n#12 …/omeka/application/libraries/globals.php(1681): Zend_View_Abstract->__call()\n#13 …/omeka/application/libraries/globals.php(1695): common()\n#14 /usr/local/htdocs/omeka/themes/berlin/index.php(1): head()\n#15 /usr/local/htdocs/omeka/application/libraries/Omeka/View.php(114): include(‘/usr/local/htdo…’)\n#16 …/omeka/application/libraries/Zend/View/Abstract.php(889): Omeka_View->_run()\n#17 …/omeka/application/libraries/Zend/Controller/Action/Helper/ViewRenderer.php(912): Zend_View_Abstract->render()\n#18 …/omeka/application/controllers/IndexController.php(16): Zend_Controller_Action_Helper_ViewRenderer->renderScript()\n#19 …/omeka/application/libraries/Zend/Controller/Action.php(516): IndexController->indexAction()\n#20 …/omeka/application/libraries/Zend/Controller/Dispatcher/Standard.php(308): Zend_Controller_Action->dispatch()\n#21 …/omeka

Thanks,
Heather

You’re hitting a pretty uncommon corner of the code which has an incompatibility issue with PHP 8 and up that we hadn’t previously discovered. This code pretty much only comes up if your navigation has an entry that uses an “interesting” scheme (i.e., not http or https).

The fix is a simple one, but we’ll have to make an updated release of the Omeka Classic core for it.

Omeka Classic 3.1.2 contains the fix for this problem.

Great! Thanks so much.