0
Welcome Guest! Login
0 items Join Now

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

    • Matt's Avatar
    • Matt
    • Preeminent Rocketeer
    • Posts: 21939
    • Thanks: 3156
    • messin' with stuff

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

    Posted 4 weeks 7 hours ago
    • Do make sure Gantry's update... this was noted in the Changelog a few versions back: github.com/gantry/gantry5/blob/develop/CHANGELOG.md#04292022
    • 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 weeks 3 days ago
    • We are using Gantry 5.5.19 which is the latest version isn't it?

      I also tried commenting out the line you suggested earlier but we still get a white screen. I have PHP error reporting set to maximum and I have Joomla debugging on. So it's fairly odd to get a white screen.

      I have reinstalled the latest version of the Gantry component twice just to check no files were missed in the install.
    • Last Edit: 3 weeks 3 days ago by Eoin.
    • Owner of Square Balloon
    • Matt's Avatar
    • Matt
    • Preeminent Rocketeer
    • Posts: 21939
    • Thanks: 3156
    • messin' with stuff

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

    Posted 3 weeks 3 days ago
    • Can you answer these questions?
      Matt wrote:
      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? (Edit: You mentioned that this menu had other/previous child items) Have you tried rebuilding the child item itself (is it just an Article or some other plugin endpoint?)?

      Do you have other menus you can add new child items to successfully?
    • Last Edit: 3 weeks 3 days 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 weeks 3 days ago
    • we can add to both the parent menu and add to other menus as a child successfully.
      its one very specific menunwe cabt donitnwkth. its very perculiar. also ifnthebitem is unpublished the error still occurs. its only fixed if the item is trashed kr delted fully.
      an additional bit of informstionnthat occurs to me. there is a joomla articles particle. thos is only clickablen if we have built a menu item for it. i wonder if there is some dodgy code in an override maybe.
      apologies for for any typos, written on my phone on a train.
    • Owner of Square Balloon
    • Matt's Avatar
    • Matt
    • Preeminent Rocketeer
    • Posts: 21939
    • Thanks: 3156
    • messin' with stuff

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

    Posted 3 weeks 3 days ago
    • I'm at a loss for why there is no menu.yaml file present...

      I wonder if it would work if everything was defaulted into a single column... the fact that your video shows you have it in 2 columns should only be possible if there's a menu.yaml file...

      I tried accessing your Gantry Menu editor but I get the same error as the frontend of your site is displaying... are you able to get it back to a point like you had in your opening video where that error isn't present?
    • 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 weeks 16 hours ago
    • Sure, so the way to get it back is simply to set the "jacob's" menu items to "trashed" (there are 2 of them). They are the issue, removing them fixes the issue.

      You can't unpublish, you can move them to a new menu or trash them. You can see under the menu "company" we have "jacobs 2" which works fine, so long as you don't move it under the products menu.

      I've done that now so you can now visit the menu again.
    • Last Edit: 3 weeks 16 hours ago by Eoin.
    • Owner of Square Balloon
    • Matt's Avatar
    • Matt
    • Preeminent Rocketeer
    • Posts: 21939
    • Thanks: 3156
    • messin' with stuff

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

    Posted 2 weeks 5 days ago
    • This is definitely over my head... but what it appears to be is an item limitation... it's not the Jacob's item itself, it's just ANY item(s) over 30 items (I guess??) that triggers the error... since your Christmas item was hidden I trashed that and was able to add Jacob's back to the menu... I tried debugging it... it's definitely line 700 of AbstractMenu.php where the recursion occurs... but I couldn't find any child that referred back to a parent (which is the only thing that made since to me) that would cause this to infinitely loop... Maybe a 3rd column would help (smaller Groups then? Maybe the item limitation is ~16 per column?). Maybe it's something with the Parent item of Products that's recursively referring to child/parent (I tried changing it to a Menu header instead of a Cat List, didn't help)? Unfortunately I'm at a loss, this would require more testing and a submission to the Gantry Github if indeed there's something magic (tragic) about having more than 30 child items in a Joomla menu.
    • Last Edit: 2 weeks 5 days ago by Matt.
    • The following users have thanked you: Eoin

    • 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:
    • Matt's Avatar
    • Matt
    • Preeminent Rocketeer
    • Posts: 21939
    • Thanks: 3156
    • messin' with stuff

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

    Posted 2 weeks 5 days ago
    • AbstractMenu.php, sortAll() function sequence in this scenario:

      Before it errors it's trying to $instance->sortAll(); the $instance that's set is line 316, 'Get menu items from the CMS.'

      This is what calls setGroupToChildren, line 649
              $item = $this->items[$key];
              if (!$ordering) {
                  $this->setGroupToChildren($item);
       
                  return;
              }

      And then this is that function, on line 700, where it infinitely loops (seemingly, only if there's more than 30 items in the current child group):
          protected function setGroupToChildren($item)
          {
              $groups = $item->groups();
              foreach ($groups as $group => $children) {
                  foreach ($children as $child) {
                      $child->group = $group;
                      $this->setGroupToChildren($child);
                  }
              }
          }
    • Last Edit: 2 weeks 5 days ago by Matt.
    • The following users have thanked you: Eoin

    • 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 weeks 3 days ago
    • Good troubleshooting! Well worked out.

      3 columns does indeed solve the problem! I'll raise it at Github.

      Interestingly 3 columns solves the problem EVEN if you don't populate the third column! But I was seeing a weird issue where another random menu item was appearing in that column but wasn't even a child of that menu item.
    • Last Edit: 2 weeks 3 days ago by Eoin.
    • Owner of Square Balloon
    • Matt's Avatar
    • Matt
    • Preeminent Rocketeer
    • Posts: 21939
    • Thanks: 3156
    • messin' with stuff

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

    Posted 2 weeks 3 days ago
    • I may check back on this but I would recommend trying to stick to single columns if possible in dropdown menus (or use an alternative menu plugin/extension instead of Gantry). I'm not a database guy, which is why I love Gantry and other flatfile systems... and I'm still at a loss as to why there's no menu.yaml file... if there WAS we could manipulate the layout there somewhat easily... must be a Joomla thing where it's stored in the database because WordPress and Grav both still have a menu.yaml file and Gantry for Joomla at least USED to have one too...

      Maybe trashing and completely rebuilding Contact would help

      Trying to recreate the scenario from scratch would be useful troubleshooting as well... ideally use Helium (like you are) and creating 35 new pages with simple page names and menu item names (alpha characters only; I tried deleting all your apostrophes in your menu names as well, to no avail) and then stick those all under a simple parent menu item in various column arrangements until it breaks, trying to note any specific arrangement where it does not break.

      I can't promise anyone will get to the Github ticket any time soon, but I'm sure they'd appreciate all the detail possible when they do
    • Last Edit: 2 weeks 3 days 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.052 seconds