We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24374
    • 322 Posts
    Only 10 items are showing up in the menu editor (Top Menu) underneath any particular menu heading. I've got more than 10 extras installed, but I can't sort them because they don't all show up under the Extras menu. I have to go into the back end and edit the menuindex using a MySQL editor. Should I enter a report in Github? Anyone else have this problem, or know a solution?
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Definitely a problem. Menu 11 and Menu 12 aren't displayed.

      In fact, they aren't in the DOM at all, Firebug only has 10 li elements in the "Extras" child ul. [ed. note: sottwell last edited this post 11 years, 8 months ago.]
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 24374
        • 322 Posts
        Quote from: sottwell at Jan 02, 2015, 08:36 PM
        Definitely a problem. Menu 11 and Menu 12 aren't displayed.

        In fact, they aren't in the DOM at all, Firebug only has 10 li elements in the "Extras" child ul.

        OK, bug report is filed.
        https://github.com/modxcms/revolution/issues/12244
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Ok... core/model/modx/processors/system/menu/getnodes.class.php arbitrarily sets the limit to 10.
           * @param integer $limit (optional) The number of records to limit to. Defaults
           * to 10.
          ...
              public function initialize() {
                  $this->setDefaultProperties(array(
                      'limit' => 10,
                      'id' => '',
                  ));
                  $id = $this->getProperty('id');
                  $this->setProperty('id', str_replace('n_','',$id));
          
                  return parent::initialize();
              }
          
          
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            Interesting. The parent class, modObjectGetListProcessor, has a limit of 20.
              Studying MODX in the desert - http://sottwell.com
              Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
              Join the Slack Community - http://modx.org
              • 24374
              • 322 Posts
              Quote from: sottwell at Jan 02, 2015, 09:01 PM
              Ok... core/model/modx/processors/system/menu/getnodes.class.php arbitrarily sets the limit to 10.
              Quote from: sottwell at Jan 02, 2015, 09:07 PM
              Interesting. The parent class, modObjectGetListProcessor, has a limit of 20.
              Weird. Why is there any limit at all??? I got rid of the line "'limit' => 10," and now they all show up (until I reach 20, I guess!).
                • 3749
                • 24,544 Posts
                Interesting. I have 12 Extras showing in MODX 2.2.13.
                  Did I help you? Buy me a beer
                  Get my Book: MODX:The Official Guide
                  MODX info for everyone: http://bobsguides.com/modx.html
                  My MODX Extras
                  Bob's Guides is now hosted at A2 MODX Hosting
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  Quote from: rainbowtiger at Jan 02, 2015, 09:10 PM
                  I got rid of the line "'limit' => 10," and now they all show up (until I reach 20, I guess!).
                  Set the 'limit' to any limit you want for it to override that parent class default of 20. It just ends up being used in a getCollection query.
                    Studying MODX in the desert - http://sottwell.com
                    Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                    Join the Slack Community - http://modx.org
                    • 28042 ☆ A M B ☆
                    • 24,524 Posts
                    Quote from: BobRay at Jan 03, 2015, 01:21 AM
                    Interesting. I have 12 Extras showing in MODX 2.2.13.
                    I don't see how it's doing it, the code is a little different there, but it still sets a default limit of 10 in getnodes.class.php
                    $limit = $modx->getOption('limit',$scriptProperties,10);
                    


                    No, wait... just before that,
                    $isLimit = !empty($scriptProperties['limit']);
                    

                    and then later,
                    if ($isLimit) $c->limit($limit,$start);
                    

                    I have no idea where $scriptProperties would come from in this case.
                      Studying MODX in the desert - http://sottwell.com
                      Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                      Join the Slack Community - http://modx.org
                      • 24374
                      • 322 Posts
                      Quote from: sottwell at Jan 03, 2015, 03:28 AM
                      Quote from: BobRay at Jan 03, 2015, 01:21 AM
                      Interesting. I have 12 Extras showing in MODX 2.2.13.
                      I don't see how it's doing it, the code is a little different there, but it still sets a default limit of 10 in getnodes.class.php
                      Quote from: sottwell at Jan 03, 2015, 03:28 AM
                      and then later,
                      if ($isLimit) $c->limit($limit,$start);
                      

                      Is getnodes.class.php used anywhere else other than by the menu editor? If so, changing the default limit would change things elsewhere. It sounds a little like the code is expecting there to be some sort of pagination system for people to view 10 things at a time, rather than 10 things total. Yes?