gantry / gantry5

:rocket: Next Generation Template / Theme Framework
http://gantry.org
1.03k stars 204 forks source link

[BUG] [PHP8.0] 404 error on some menu link with PHP 8.0 and Joomla 4.2.2 #3079

Closed morphinestyle closed 1 year ago

morphinestyle commented 2 years ago

PHP 8.0 with Gantry 5.5.14 + Hydrogen 5.5.14 can't load some menu items and J4.2.2 return a 404 error page.

TESTING: If i turn back to PHP 7.4 menus works again and load article. If i turn to Cassiopeia, even with PHP 8.0, menus works again.

morphinestyle commented 2 years ago

Creating EX NOVO the two articles and menus i solved for that items but now other articles/menu return errors... EDIT 2: i continue to create new articles to replace the old ones, i fill it with old articles content, but i fix the new item menu/articles but broke someone from the old!!! There's no way to fix, it's a loop!

morphinestyle commented 1 year ago

Here the error message:

error - Uncaught Throwable of type ArgumentCountError thrown with message "2 arguments are required, 1 given". Stack trace: #0 [ROOT]/libraries/src/Language/Text.php(283): sprintf() #1 [ROOT]/templates/g5_hydrogen/html/plg_content_pagenavigation/default.php(42): Joomla\CMS\Language\Text::sprintf() #2 [ROOT]/plugins/content/pagenavigation/pagenavigation.php(235): include('...') #3 [ROOT]/libraries/src/Plugin/CMSPlugin.php(279): PlgContentPagenavigation->onContentBeforeDisplay() #4 [ROOT]/libraries/vendor/joomla/event/src/Dispatcher.php(486): Joomla\CMS\Plugin\CMSPlugin->Joomla\CMS\Plugin\{closure}() #5 [ROOT]/libraries/src/Application/EventAware.php(107): Joomla\Event\Dispatcher->dispatch() #6 [ROOT]/components/com_content/src/View/Article/HtmlView.php(233): Joomla\CMS\Application\WebApplication->triggerEvent() #7 [ROOT]/libraries/src/MVC/Controller/BaseController.php(639): Joomla\Component\Content\Site\View\Article\HtmlView->display() #8 [ROOT]/components/com_content/src/Controller/DisplayController.php(121): Joomla\CMS\MVC\Controller\BaseController->display() #9 [ROOT]/libraries/src/MVC/Controller/BaseController.php(672): Joomla\Component\Content\Site\Controller\DisplayController->display() #10 [ROOT]/libraries/src/Dispatcher/ComponentDispatcher.php(143): Joomla\CMS\MVC\Controller\BaseController->execute() #11 [ROOT]/components/com_content/src/Dispatcher/Dispatcher.php(56): Joomla\CMS\Dispatcher\ComponentDispatcher->dispatch() #12 [ROOT]/libraries/src/Component/ComponentHelper.php(355): Joomla\Component\Content\Site\Dispatcher\Dispatcher->dispatch() #13 [ROOT]/libraries/src/Application/SiteApplication.php(200): Joomla\CMS\Component\ComponentHelper::renderComponent() #14 [ROOT]/libraries/src/Application/SiteApplication.php(241): Joomla\CMS\Application\SiteApplication->dispatch() #15 [ROOT]/libraries/src/Application/CMSApplication.php(294): Joomla\CMS\Application\SiteApplication->doExecute() #16 [ROOT]/includes/app.php(61): Joomla\CMS\Application\CMSApplication->execute() #17 [ROOT]/index.php(32): require_once('...') #18 {main}

MidiBro commented 1 year ago

Hi there! I just want to report briefly that I have a very similar problem which seems to have the same cause. I also have some menu items that return a 404 error page. For me it's not articles, but links from a component (VikBooking).

PHP 8.0.22 Joomla! 4.2.4 Gantry 5.5.14

With PHP 7.4 it works again for me. Finding that out was a very long journey for me...

My error message: 0 3 arguments are required, 2 given

regards Markus

MidiBro commented 1 year ago

Hi again. Just wnat to point out that unfortunately the issue with the latest Version of Gantry (5.5.15) and PHP 8 still exists. The part of the URL that causes the trouble: .....?task=showprc&roomsnum=1&roomopt[0]=1&adults[0]=6&children[0]=0&days=8&checkin=1672916400&checkout=1673600400

regards Markus

morphinestyle commented 1 year ago

Hello! Any news with this issue? :( This issue is blockinig the PHP update, still forcing to use PHP 7.4

rhukster commented 1 year ago

its' being worked on...

morphinestyle commented 1 year ago

Hello! Latest version 5.5.16 update has:

but there is no reference to this report: by chance, has this problem already been solved?

morphinestyle commented 1 year ago

Hello @rhukster the 5.5.16 update don't solve this issue. I can't move to PHP 8.0, i'm forced to PHP 7.4 :(

N8Solutions commented 1 year ago

@morphinestyle have you tried testing things on a clean install on your server? I have not run into this issue and it would help the Gantry 5 team if it could be duplicated. I'd be happy to run through some things with you to see if I can replicate the issue on my end using a testing site. Since this isn't more widely reported, it could be an issue with either the setup of the server you are using or a compatibility issue with another extension.

morphinestyle commented 1 year ago

Hello @N8Solutions, i use the exact same set of extensions on every site, and Gantry is always among them, the difference is that on this site there are a total of 162 articles in 3 languages, plus service pages... I think the site that exceeds 200 link on the menu, a value that I don't reach with any other website. In the past I remember testing disabling, and also uninstalling, all other extensions but it didn't fix the problem.

But I might try again. The thing I remember very well is that using Cassiopeia everything works perfectly.

Creating from scratch over 200 pages of articles full of custom fields with the relative menus in 3 languages ​​is really challenging. I can try other tests.

Anyway: This is the only website that gives this problem as soon as I switch to PHP 8.0. But from the debug message it is impossible to understand what happened?

morphinestyle commented 1 year ago

@N8Solutions you gave me light...

I wrote: "But from the debug message it is impossible to understand what happened?" I'm not a developer, I rarely do any overrides, but I looked closely at the debug message at the top of this Issue Page and read that there is an override path in the code.

I removed it and everything works fine! I'll try to figure out what causes this "random error" in the override.

My apologies, and I'm very sorry, but I hadn't noticed this at all in the Joomla debug info, until now. Thanks to all guys @mahagr @rhukster, I love Gantry, and I admire your work and especially your patience.

N8Solutions commented 1 year ago

I'm happy to know I sparked that idea for you! Glad you got it sorted!