Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
After upgrading from 7.x.2.2 to 7.x.2.4 the ascending/descending icons are no longer rendered along with the sort links (price, latest and title) after pressing one of the sort links. I noticed that these icons do show up correctly if I assign the search sort block to the content region. When I assign the search sort block to another region than the content region (e.g. Search Breadcrumb region), the sort icons are disappearing after pressing a sort link. I would like to have the sort links with icons in a dedicated region. Having them in the content region causes some layout issues.
Comment | File | Size | Author |
---|---|---|---|
#12 | 1930594_fix_query_sort_disappearing.patch | 809 bytes | m42 |
#2 | sort-icon-rendering-issue.png | 528.16 KB | rfamans |
Comments
Comment #1
Cookiz CreditAttribution: Cookiz commentedCan you please provide a screenshot and precise the theme you're using (omega_kickstart or commerce_kickstart_theme)
Comment #2
rfamans CreditAttribution: rfamans commentedHere is the screenshot. I use a custom theme that is based on the (full) Omega theme (not the omega-kickstart or commerce kickstart theme!).
Thanks for your help.
Comment #3
Cookiz CreditAttribution: Cookiz commentedYou'll need to add theses lines in your css file. (global.css)
Comment #4
rfamans CreditAttribution: rfamans commentedThanks. Unfortunately the problem is still there. It does not seem to be a CSS issue. I checked the HTML and the sort images are actually not being rendered in the HTML:
Comment #5
jsacksick CreditAttribution: jsacksick commentedWell, it's a Search API sorts issue, the sort item is not considered as active, let's move the issue there.
Comment #6
Anonymous (not verified) CreditAttribution: Anonymous commentedI couldn't reproduce this. If you say that the arrows disappear only in a non-content region, then there seems to be something else going on.
The arrows come from Drupal core using
theme('tablesort_indicator', ...)
. Maybe you are overriding this function in a custom region?Comment #7
jsacksick CreditAttribution: jsacksick commentedI didn't have the time to patch it but it seems that when the block is in an other region, the $query->getSort() method doesn't return the correct active sort, there's indeed a bug, you should normally be able to reproduce it.
Comment #8
Ogredude CreditAttribution: Ogredude commentedI am having this same issue. I have found that putting the Search sorts block into the Preface First region on the omega_kickstart theme results in the "active" not being placed on the buttons, and so no extra markup and no sort asc/desc markings. Putting the block in the Content region makes it render the search asc/desc indicators properly.
It appears that jsacksick is correct in #7, the $query->getSort() doesn't return the same thing depending on which region/theme the block is displayed in.
Working:
Non-working:
Do we have any more information on what's causing this?
I've been testing it by switching between the omega_kickstart theme (where it works) and my theme (where it does not work).
I've found that the $query is different depending on which theme is enabled. In case it helps, I've stored serialized $query from a working and non-working instance at https://gist.github.com/ogredude/422ce8fea4c08079d468
I don't know what to make of this. I'm not sure why the query would be different simply depending on the theme (or region) the block is being displayed in.
Comment #9
gurrmag CreditAttribution: gurrmag commentedDo all of your sorts include a range such as price?
This patch: https://drupal.org/node/2071603#comment-7782605 fixed the issue for me.
Comment #10
Anonymous (not verified) CreditAttribution: Anonymous commentedPatch was implemented, fixed.
Comment #12
m42 CreditAttribution: m42 commentedI'm reopening this issue because jsacksick'd good deduction in #7 has never been corrected and the bug persists.
Here is a patch that should do the trick (it works at least for me).
Your reviews are welcome. :)
Comment #13
m42 CreditAttribution: m42 commentedComment #14
Anonymous (not verified) CreditAttribution: Anonymous commentedThanks, committed to dev-x.
http://cgit.drupalcode.org/search_api_sorts/commit/?id=de8b6fe