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.

Files: 
CommentFileSizeAuthor
#2 sort-icon-rendering-issue.png528.16 KBrfamans

Comments

Can you please provide a screenshot and precise the theme you're using (omega_kickstart or commerce_kickstart_theme)

StatusFileSize
new528.16 KB

Here 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.

Status:Active» Fixed

You'll need to add theses lines in your css file. (global.css)

.block-search-api-sorts .content ul.search-api-sorts li .search-api-sort-active .sort-asc img,
.block-search-api-sorts .content ul.search-api-sorts li .search-api-sort-active .sort-desc img {
vertical-align: baseline;
}

Thanks. 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:

<ul class="search-api-sorts">
  <li class="first"><a href="/producten?sort=field_product_commerce_price_amount_decimal_asc&amp;order=asc" class="sort-item active">Price</a></li>
  <li><a href="/producten?sort=created&amp;order=asc" class="sort-item active">Latest</a></li>
  <li class="last"><a href="/producten?sort=title_field&amp;order=asc" class="sort-item active">Title</a></li>
</ul>

Project:Commerce Kickstart» Search API sorts
Version:7.x-2.4» 7.x-1.x-dev
Component:User interface» Code
Status:Fixed» Active

Well, it's a Search API sorts issue, the sort item is not considered as active, let's move the issue there.

Status:Active» Postponed (maintainer needs more info)

I 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?

I 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.

Status:Postponed (maintainer needs more info)» Active

I 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:

array (
  'field_product_commerce_price_amount_decimal_asc' => 'ASC',
)

Non-working:

array (
  'field_product_commerce_price_amount_decimal_desc' => 'DESC',
)

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.

Do all of your sorts include a range such as price?

This patch: https://drupal.org/node/2071603#comment-7782605 fixed the issue for me.

Issue summary:View changes
Status:Active» Fixed

Patch was implemented, fixed.

Status:Fixed» Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.