Jump to content

Allow to change $autoPopulate option with NODE form helper


teraßyte

Recommended Posts

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.

Link to comment
Share on other sites

  • 1 month later...

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.

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...