Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
teraßyte Posted August 17, 2016 Posted August 17, 2016 When using the _Node form helper there is NO way to pass an option to disable the $autoPopulate value in order to not show the children of the root categories. Since I have quite a few children nodes in the app I want to show only the root ones initially to the user but this is not possible right now: /* Display */ return \IPS\Theme::i()->getTemplate( 'forms', 'core', 'global' )->node( $this->name, $selected, $this->options['multiple'], $this->options['url'], $nodeClass::$nodeTitle, $nodes, $this->options['zeroVal'], $noJS, $permCheck, $this->options['subnodes'], $this->options['togglePerm'], $this->options['toggleIds'], $disabledCallback, $this->options['zeroValTogglesOn'], $this->options['zeroValTogglesOff'], TRUE, $children, $this->options['class'], $this->options['where'], is_array( $this->options['disabledIds'] ) ? $this->options['disabledIds'] : array(), $this->options['noParentNodes'], $noParentNodes ); The value I want to be able to change is the TRUE right before $children. The change should also account for a node field shown with an already chosen value though, even if $autoPopulate is FALSE it should still show the selected node only and all children for it if needed.
HeadStand Posted August 18, 2016 Posted August 18, 2016 This one can also be done with a theme hook function overload.
teraßyte Posted August 18, 2016 Author Posted August 18, 2016 Yep I know, but why keep adding hook after hook for every little things when we can ask for it to be supported by default? There are a lot of these little things that can help speed things up if changed.
bfarber Posted October 3, 2016 Posted October 3, 2016 I have committed an autoPopulate option - I can't say yet whether this will be included in 4.1.16 or later, but it's in the pipeline.
teraßyte Posted October 3, 2016 Author Posted October 3, 2016 Thanks, I hope it does make it into 4.1.16. It will help reduce a huge amount of queries on the form I use to select a category. Having 23.600 categories (with 36 root categories) makes the page use 450+ queries just to populate the children data. That's quite a big amount... but children() doesn't use the data from loadIntoMemory(), so I'm working on a fix for that for now. I'll submit a bug report later on when I have more details anyway.
bfarber Posted October 4, 2016 Posted October 4, 2016 16 hours ago, teraßyte said: Thanks, I hope it does make it into 4.1.16. It will help reduce a huge amount of queries on the form I use to select a category. Having 23.600 categories (with 36 root categories) makes the page use 450+ queries just to populate the children data. That's quite a big amount... but children() doesn't use the data from loadIntoMemory(), so I'm working on a fix for that for now. I'll submit a bug report later on when I have more details anyway. Awesome, thanks!
teraßyte Posted October 4, 2016 Author Posted October 4, 2016 Ticket submitted in case you want to take a look (#964555), I was also wrong about the number of queries. It was 850+
Recommended Posts
Archived
This topic is now archived and is closed to further replies.