0
Welcome Guest! Login
0 items Join Now

Gantry is 500 error if I add a child to the menu

    • Eoin's Avatar
    • Eoin
    • Hero Rocketeer
    • Posts: 424
    • Thanks: 18

    Gantry is 500 error if I add a child to the menu

    Posted 3 months 3 weeks ago
    • This is a confusing one.

      The website works, the menu has children.

      If I add a new child, the type being a single article. I get an error 500.

      If I unpublish it I still get the same issue.

      If I trash it the issue is resolved.

      If I move the item out of the child into the main menu it is also resolved.

      Here is a video to show what I mean:

      Could this be anything to do with either Helium or with the gantry Menu?

      Or can anyone think of any troubleshooting steps I can take? The Joomla Debug doesn't show anything, it's just a white error 500 page
    • Owner of Square Balloon
    • Matt's Avatar
    • Matt
    • Preeminent Rocketeer
    • Posts: 22057
    • Thanks: 3191
    • messin' with stuff

    Re: Gantry is 500 error if I add a child to the menu

    Posted 3 months 2 weeks ago
    • There should be a server log of some kind for any 5xx response... apache/nginx logs... it's a server level response, something occurring before Joomla. Maybe contact your host while it's broken and give them a link where they can generate the 500 error themselves and ask them to provide a log for the underlying cause, no 500 error should go unlogged.

      You can try backing up and deleting the /custom/config/menu/menu.yaml file which (maybe there's no /menu/ folder and it's just in /custom/config/) will resync the Gantry menu editor with whatever's setup in Joomla... you will lose your multi-column layout but I do wonder if it's just something in there that's getting messed up with you moving the item from a parent to a child in Joomla but Gantry has a config for it being placed in a multi-column layout as a child... at least that might get the error to clear and then you can go about rebuilding the multi-column layout
    • Last Edit: 3 months 2 weeks ago by Matt.
    • SEARCH the forum first! These boards are rich in knowledge and vast in topics. This includes searching just the 'Solved' forums, using Google, and using ChatGPT :woohoo:
    • Eoin's Avatar
    • Eoin
    • Hero Rocketeer
    • Posts: 424
    • Thanks: 18

    Re: Gantry is 500 error if I add a child to the menu

    Posted 3 months 2 weeks ago
    • I see this structure:


      /templates/g5_helium/custom/config/menu

      But there is no yaml file there. Also not one in the folder before.

      I'll check the logs.
    • Owner of Square Balloon
    • Matt's Avatar
    • Matt
    • Preeminent Rocketeer
    • Posts: 22057
    • Thanks: 3191
    • messin' with stuff

    Re: Gantry is 500 error if I add a child to the menu

    Posted 3 months 2 weeks ago
    • Make sure Gantry is up to date.

      If you go to the Menu Editor in Gantry and Save it should generate one... it's only needed for the order of multi column layouts and for any other non-default settings you configure within the Gantry Menu Editor... a lack of a file should mean that it syncs with the CMS.

      Ultimately getting the log entry of why your server threw a 5xx response will be the most beneficial here.
    • SEARCH the forum first! These boards are rich in knowledge and vast in topics. This includes searching just the 'Solved' forums, using Google, and using ChatGPT :woohoo:
    • Eoin's Avatar
    • Eoin
    • Hero Rocketeer
    • Posts: 424
    • Thanks: 18

    Re: Gantry is 500 error if I add a child to the menu

    Posted 2 months 4 weeks ago
    • Weirdly all I see in the logs is this:

      [22-Aug-2024 13:49:32 UTC] PHP Fatal error: Uncaught DivisionByZeroError: Division by zero in /srv/admin/htdocs/apcu.php:840
      Stack trace:
      #0 /srv/admin/htdocs/apc.php(4): require()
      #1 {main}
      thrown in /srv/admin/htdocs/apcu.php on line 840

      I have disabled APC in PHP.ini to see if that could be the issue, but the error only occurs once, no matter how many times I load the page, so I don't think this is the case.

      I felt sure I saw twig errors previously but I don't see any today.

      Ok I copied the site onto my server so I could get better information, and I turned on XDebug.

      I now get a bit more info.

      Error
      Xdebug has detected a possible infinite loop, and aborted your script with a stack depth of '512' frames
      Previous exceptions
      Xdebug has detected a possible infinite loop, and aborted your script with a stack depth of '512' frames (0)


      home/okanessquareball/public_html/libraries/gantry5/src/classes/Gantry/Component/Menu/AbstractMenu.php


              $alias = Gantry::basename($path);
              $key = $map && isset($map[$alias]['id']) ? $map[$alias]['id'] : $path;
       
              if (!isset($this->items[$key]) || !$this->items[$key]->hasChildren()) {
                  return;
              }
       
              // Ordering in menu item itself.
              $item = $this->items[$key];
              if (!$ordering) {
                  $this->setGroupToChildren($item);
       
                  return;
              }
       
              $order = [];
              $newMap = [];
              if ($this->isAssoc($ordering)) {
                  foreach ($ordering as $key => $value) {
                      if ($map) {
                          $newMap = isset($map[$key]['children']) ? $map[$key]['children'] : [];

      This does somehow point to it being a Gantry issue I think.
    • Last Edit: 2 months 4 weeks ago by Eoin.
    • Owner of Square Balloon
    • Matt's Avatar
    • Matt
    • Preeminent Rocketeer
    • Posts: 22057
    • Thanks: 3191
    • messin' with stuff

    Re: Gantry is 500 error if I add a child to the menu

    Posted 2 months 4 weeks ago
    • Gantry is just powering the theme, the skin... Joomla is what's building the menu and the routes... if this is only occurring when adding a child menu item it's something between Joomla and this file (I'm not familiar with what "APC" is).

      Is it just this particular Menu item where it occurs if adding a child? What if you add 2 child items? Try a different menu item type as a child... is the issue specific to a the single article type? What about a Category Blog List? If you Switch to PHP 7.4 does the issue clear?
    • SEARCH the forum first! These boards are rich in knowledge and vast in topics. This includes searching just the 'Solved' forums, using Google, and using ChatGPT :woohoo:
    • Eoin's Avatar
    • Eoin
    • Hero Rocketeer
    • Posts: 424
    • Thanks: 18

    Re: Gantry is 500 error if I add a child to the menu

    Posted 2 months 4 weeks ago
    • APC is a cache handler. I've copied it to my server, APC isn't the issue.

      I've updated the above post.

      two menus makes no difference.

      The only issue is if it's a child of the products menu item, all other menu items don't have an issue and neither does the parent menu item.

      I can make double column dropdowns in the other menu items too. it's just this one menu item that doesn't work.

      I can't use PHP 7.4 because it's Joomla 5.

      I'm using php 8.1 I tried with 8.3, same result.
    • Last Edit: 2 months 4 weeks ago by Eoin.
    • Owner of Square Balloon
    • Eoin's Avatar
    • Eoin
    • Hero Rocketeer
    • Posts: 424
    • Thanks: 18

    Re: Gantry is 500 error if I add a child to the menu

    Posted 2 months 4 weeks ago
    • I have tried changing from Helium template to Hydrogen template and I get exactly the same issue so I can rule out the template.

      If I change to Cassiopia the website loads.
    • Owner of Square Balloon
    • Eoin's Avatar
    • Eoin
    • Hero Rocketeer
    • Posts: 424
    • Thanks: 18

    Re: Gantry is 500 error if I add a child to the menu

    Posted 2 months 4 weeks ago
    • I've tried repairing the database.

      I've also tried rebuilding the menus.
    • Last Edit: 2 months 4 weeks ago by Eoin.
    • Owner of Square Balloon
    • Matt's Avatar
    • Matt
    • Preeminent Rocketeer
    • Posts: 22057
    • Thanks: 3191
    • messin' with stuff

    Re: Gantry is 500 error if I add a child to the menu

    Posted 2 months 4 weeks ago
    • Somehow I missed the 2nd half of your post regard the Xdebug error... try commenting out the entire if/else statement in AbstractMenu.php from line 656 to 688

      You said you rebuilt the menu completely and it didn't resolve the issue... at what point does it start breaking? Only when adding this specific child item? Other child items are able to be added without error? Have you tried rebuilding the child item itself (is it just an Article or some other plugin endpoint?)?

      Edit: I tried trashing the Hunky Dorys menu item, but it still errors
    • Last Edit: 2 months 3 weeks ago by Matt.
    • SEARCH the forum first! These boards are rich in knowledge and vast in topics. This includes searching just the 'Solved' forums, using Google, and using ChatGPT :woohoo:

Time to create page: 0.048 seconds