User tests: Successful: Unsuccessful:
When we update direction, the default newDirection
variable is 'ASC', but it will cause the wrong direction if we didn't write ordering options in filter.xml
, the auto generated ordering option in list[fullordering]
will cause grid not sortable in DESC
.
I changed it to get data from data-direction
and it working fine now.
Looks like nobody tested the PR so far. From my little experience it can have different sources:
1. Testers don't think it's an issue or not big enough to be worth the time to test it.
2. Testers don't understand the issue.
3. Testers don't know how to test it.
I think you explained the issue. It sure would help to add detailed instructions how to reproduce and test it, and maybe a bit less technical instructions how to reproduce the issue.
Keep in mind that testers usually aren't coders and don't know how the searchtools work in details.
Looking at the code, you may have to include a fallback in case data-direction
is missing, or is this always available for sure? Also in 3rd party extensions using this search tools?
Yes, I think the data-direction
should always exists except 3rd developers override the layouts, please see:
https://github.com/joomla/joomla-cms/blob/staging/layouts/joomla/searchtools/grid/sort.php#L17
Actually, this code will not easy tested because no core extensions will use this function, all core extensions use filter_xxxx.xml
to configure sorting fields. I'm 3rd developer so I will find this bug.
Though this is not used so often but I think it should be fix since we provide this feature for anyone to use it.
Here is an easy way to test this issue.
In administrator/components/com_content/models/forms/filter_articles.xml
, we can see this ordering configuration:
<field
name="fullordering"
type="list"
label="COM_CONTENT_LIST_FULL_ORDERING"
description="COM_CONTENT_LIST_FULL_ORDERING_DESC"
onchange="this.form.submit();"
default="a.title ASC"
>
<option value="">JGLOBAL_SORT_BY</option>
<option value="a.ordering ASC">JGRID_HEADING_ORDERING_ASC</option>
<option value="a.ordering DESC">JGRID_HEADING_ORDERING_DESC</option>
<option value="a.state ASC">JSTATUS_ASC</option>
<option value="a.state DESC">JSTATUS_DESC</option>
<option value="a.title ASC">JGLOBAL_TITLE_ASC</option>
<option value="a.title DESC">JGLOBAL_TITLE_DESC</option>
<option value="category_title ASC">JCATEGORY_ASC</option>
<option value="category_title DESC">JCATEGORY_DESC</option>
<option value="association ASC" requires="associations">JASSOCIATIONS_ASC</option>
<option value="association DESC" requires="associations">JASSOCIATIONS_DESC</option>
<option value="a.access ASC">JGRID_HEADING_ACCESS_ASC</option>
<option value="a.access DESC">JGRID_HEADING_ACCESS_DESC</option>
<option value="a.created_by ASC">JAUTHOR_ASC</option>
<option value="a.created_by DESC">JAUTHOR_DESC</option>
<option value="language ASC">JGRID_HEADING_LANGUAGE_ASC</option>
<option value="language DESC">JGRID_HEADING_LANGUAGE_DESC</option>
<option value="a.created ASC">JDATE_ASC</option>
<option value="a.created DESC">JDATE_DESC</option>
<option value="a.id ASC">JGRID_HEADING_ID_ASC</option>
<option value="a.id DESC">JGRID_HEADING_ID_DESC</option>
<option value="a.featured ASC">JFEATURED_ASC</option>
<option value="a.featured DESC">JFEATURED_DESC</option>
<option value="a.hits ASC">JGLOBAL_HITS_ASC</option>
<option value="a.hits DESC">JGLOBAL_HITS_DESC</option>
</field>
Just delete all options:
<field
name="fullordering"
type="list"
label="COM_CONTENT_LIST_FULL_ORDERING"
description="COM_CONTENT_LIST_FULL_ORDERING_DESC"
onchange="this.form.submit();"
default="a.title ASC"
>
<option value="">JGLOBAL_SORT_BY</option>
</field>
Then, we'll find every columns still can sort by ASC
, but not available for DESC
.
hope this information is helpful. Tested in newest Joomla!3.2.3.
I just post it in #2797 (comment)
Is this enough for test?
Thanks @asika32764
I have test this successfull. (with com_patchtester)
Befor the patch (with the modified file) i can not sort DESC (e.g. by ID)
After your patch i can sort ASC and DESC.
Good catch @asika32764
You may blame the J!Tracker Application for transmitting this comment.
Is this enough for test?
@asika32764 Apparently, yes
Thank you.
Hope this patch can help other 3rd developers.
Following the instructions (and with the modified file) able to reproduce -> not able to sort DESC
Then #2797 works as described and able to sort ASC and DESC
Set RTC on the Tracker
Thanks
You may blame the J!Tracker Application for transmitting this comment.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2014-05-16 07:43:17 |
Corrected code that did not apply anymore for themin.js file and merged to staging
Thanks
Sorry, this issue still exists in current Joomla! and it will makes grid column not sortable.
How can I know is this PR will be merged or not? Or I have to provide more information and test case?
Thank you.