Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • thesdhotel Friend
    #1070954

    I noticed that if you have empty values in some field, and you order Megafilter by that field, then the empty values will show up at the top of the list when ordering DESC. The preferred behavior would be that when there are empty values, those items should always be at the end.

    To see an example of the problem. Let’s say I’m ordering for a Custom Field called "Speed" and some items don’t have a "Speed" value set so they are empty.

    What Happens Now:

    Order by SPEED ASC (this is ok):

    TITLE                                  SPEED
    Item A                                 200
    Item B                                 500
    Item C                                 700
    Item D with no value
    Item E with no value

    Order by SPEED DESC (this is incorrect, because empty values are on top):

    TITLE                                  SPEED
    Item E with no value
    Item D with no value
    Item C                                 700
    Item B                                 500
    Item A                                 200
    

    How it should be fixed – What should happen:

    Order by SPEED ASC (same as it is now):

    TITLE                                  SPEED
    Item A                                 200
    Item B                                 500
    Item C                                 700
    Item D with no value
    Item E with no value

    Order by SPEED DESC (fixed with empty values always at the end):

    TITLE                                  SPEED
    Item C                                 700
    Item B                                 500
    Item A                                 200
    Item D with no value
    Item E with no value
    

    I hope my explaination is clear enough. Could you please address this?

    My suggested behavior is also what Microsoft Excel does for example, empty values always go at the bottom, both when sorting ASC or DESC. When sorting, you never want to see empty values on top, they should be always at the bottom. This of course goes for any type of sorting (not only numeric, also alphabetic etc.)

    Thank you!

    • This topic was modified 7 years ago by  thesdhotel.
    • This topic was modified 7 years ago by  thesdhotel.
    Mr.Cat Moderator
    #1071181

    @thesdhotel,

    Great idea, i already implement it to the megafilter sorting.

    Thanks

    • This reply was modified 7 years ago by  Mr.Cat.

    Wisdom is not a product of schooling but of the lifelong attempt to acquire it.

    thesdhotel Friend
    #1071371

    Nice! So we can hope to see this in the next update?

    Mr.Cat Moderator
    #1071453

    @thesdhotel

    Yes 🙂

    Wisdom is not a product of schooling but of the lifelong attempt to acquire it.

    thesdhotel Friend
    #1085036

    Hey guys,
    I noticed that the latest updated broke this feature again.

    Please see the differences for the file:
    components/com_jamegafilter/assets/js/megafilter.js

    https://www.diffchecker.com/FPDYTK4g

    On the left you see the current version of the file (component 1.1.1)
    This makes this feature NOT work anymore.

    On the right you see the previous version of the file (component 1.1.0)
    This made the feature WORK CORRECTLY.

    In 1.1.0 it works. In 1.1.1 it doesn’t work anymore. I think it might be because you moved the "return v1 > v2 ? d : -d;" in a wrong position? Check out the differences in lines 420-430.

    Saguaros Moderator
    #1085550

    Hi,

    Kindly share the credentials of your site: URL, Admin + FTP account, I will take a look.

    Regards

    thesdhotel Friend
    #1085581

    Hi,
    Kindly share the credentials of your site: URL, Admin + FTP account, I will take a look.
    Regards

    ?? No need to share any credentials. Also because I already fixed it on my site by restoring the old components/com_jamegafilter/assets/js/megafilter.js from the 1.1.0 version of that file.

    Restore the 1.1.0 version of that file and you will see that it works. Test this with the 1.1.1 version of that file and you will see that it doesn’t work.

    • This reply was modified 6 years, 10 months ago by  thesdhotel.
    • This reply was modified 6 years, 10 months ago by  thesdhotel.
    Saguaros Moderator
    #1085751

    Hi,

    We did test on our side but it still works fine, it may happen on your site specific, kindly share the credentials of your site so I can check and update for you.

    Regards

Viewing 8 posts - 1 through 8 (of 8 total)

This topic contains 7 replies, has 3 voices, and was last updated by  Saguaros 6 years, 10 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum