User tests: Successful: Unsuccessful:
The searchtools JLayout allows to pass some options into it. But the options need to be of different values to stick. If two are passed of same value then only the first one sticks and the second gets deleted.
The JLayout uses array_unique()
after it merged some default options with the passed options. I have no clue what the author wanted to achieve, but it's certainly wrong. array_unqiue
will make sure that the values of the array are unique.
Removing array_unique()
Edit the call to the JLayout and pass some additional options to it.
Example:
In https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_content/views/articles/tmpl/default.php#L65 change echo JLayoutHelper::render('joomla.searchtools.default', array('view' => $this));
to echo JLayoutHelper::render('joomla.searchtools.default', array('view' => $this, 'options' => array('filterButton' => false, 'searchButton' => false)));
Supported options would be
Either check by testing if the output reflects the parameters or dump the $data['options']
in the JLayout file (/layouts/joomla/searchtools/default.php).
Labels |
Added:
?
|
@test: OK from me.
PS: When I tested this pull request, I realized that "filterButton" is depended on "searchButton". Filter button section in search tools will only be displayed if we pass true to the value of both "filterButton" and "searchButton" parameters. If we set "filterButton" => true and "searchButton" => false, the filter button section in search tool is not displayed. Is it an expected behavior ?
PS: When I tested this pull request, I realized that "filterButton" is depended on "searchButton". Filter button section in search tools will only be displayed if we pass true to the value of both "filterButton" and "searchButton" parameters. If we set "filterButton" => true and "searchButton" => false, the filter button section in search tool is not displayed. Is it an expected behavior ?
This is the behavior we have in our layout but the jQuery plugin is independent. So extension developers can display it where they want and how they want.
OK @phproberto. Thanks for confirming.
2 good tests. Merging. Thanks.
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2014-10-14 06:29:44 |
@test +1
It was me :D
Search tools is based on things developed for my own extensions. It seems that I used an old layout or modified it badly when contributing it.
Thanks for the fix