No Code Attached Yet
avatar dawe78
dawe78
25 Nov 2025

I just realized an issue with searchtools. In my custom component, search direction is set to a default value, which results in selected ordering option. Select field example:

<select...>

Title ASC Title DESC Title ASC Title DESC

When I click on id column, ordering select field gets an additional option entry instead of selecting existing option (issue 1) and previous selected option is still selected (issue 2):

<select...>

Title ASC Title DESC id ASC id DESC id ASC `

In my select Model->getListQuery() method "title desc" is set for ordering, no matter which column I selected for ordering.

If I unset default value, behaviour is the same but we got only one selected option, so ordering is done as expected:

<select...>

Title ASC Title DESC id ASC id DESC id ASC `

Summary:
Issue 1: Option is added even if exists:
searchtools.js, line 460: if (desiredOption && desiredOption.length) {
desiredOption has no length, so here we always get false and new option will be added.

Issue 2: "old" option is still selected and should be de-selected before form submit

avatar dawe78 dawe78 - open - 25 Nov 2025
avatar joomla-cms-bot joomla-cms-bot - change - 25 Nov 2025
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 25 Nov 2025

Add a Comment

Login with GitHub to post a comment