Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted August 17, 20168 yr 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.
August 18, 20168 yr Author 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.
October 3, 20168 yr 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.
October 3, 20168 yr Author 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.
October 4, 20168 yr 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!
October 4, 20168 yr Author Ticket submitted in case you want to take a look (#964555), I was also wrong about the number of queries. It was 850+
Archived
This topic is now archived and is closed to further replies.