Make WordPress Core

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#35180 closed defect (bug) (fixed)

In WordPress 4.4 the_tags() is displaying tags ordered by ID instead of alphabetically by name

Reported by: flodit's profile flodit Owned by: boonebgorges's profile boonebgorges
Milestone: 4.4.1 Priority: normal
Severity: normal Version: 4.4
Component: Taxonomy Keywords: fixed-major
Focuses: Cc:

Description

After updating to WordPress 4.4 a few websites I noticed that the_tags is displaying tags ordered by ID, not alphabetically anymore.

I couldn't find any changelog about this, and I wasn't able to find any code change that could explain it.

Change History (11)

#1 @afercia
9 years ago

Not my repertoire but maybe this is related: [34217] cc @boonebgorges :)

#2 @boonebgorges
9 years ago

  • Milestone changed from Awaiting Review to 4.4.1

@flodit - Thanks very much for your ticket.

@afercia - You are correct :)

In #28922, @wonderboymusic and I agreed that order doesn't matter when updating the object term cache. But in retrospect, we were incorrect; functions like get_the_terms() may be relying on the order coming from MySQL (whether we like it or not). A possible long-term solution involves sorting terms in PHP within get_the_terms(), so that update_object_term_cache() stays lean, mean, and order-agnostic. But the performance implications of sorting in PHP rather than MySQL need exploration before dropping into a point release. For this reason, I'm going to revert the change from [34217] for 4.4.1.

#3 @boonebgorges
9 years ago

  • Owner set to boonebgorges
  • Resolution set to fixed
  • Status changed from new to closed

In 36056:

Order terms by 'name' when populating object term cache.

[34217] removed the ORDER BY clause from update_object_term_cache(), for
improved performance. But this proved to cause problems in cases where users
were expecting the results of get_the_terms() to be ordered by 'name'. Let's
revert the change for the time being, and look into more disciplined ordering
in a future release.

Props afercia.
See #28922. Fixes #35180.

#4 @boonebgorges
9 years ago

  • Keywords fixed-major added
  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening for 4.4.1.

#5 @boonebgorges
9 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 36057:

Order terms by 'name' when populating object term cache.

[34217] removed the ORDER BY clause from update_object_term_cache(), for
improved performance. But this proved to cause problems in cases where users
were expecting the results of get_the_terms() to be ordered by 'name'. Let's
revert the change for the time being, and look into more disciplined ordering
in a future release.

Merges [36056] to the 4.4 branch.

Props afercia.
See #28922. Fixes #35180.

#6 @flodit
9 years ago

That was blazing fast. Thanks :-)

#7 @jutta0303
9 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Hi,

I actually am still seeing my tags not sorted alphabetically since the 4.4 upgrade. Check my blog here: http://goo.gl/FpM0R2

I've cleared my server cache, browser cache, but it makes no difference.

#8 follow-up: @flodit
9 years ago

It should be fixed in the next minor update (4.4.1) based on the milestone.

#9 in reply to: ↑ 8 @jutta0303
9 years ago

Replying to flodit:

It should be fixed in the next minor update (4.4.1) based on the milestone.

Ah, thank you! I'm not familiar with these Core tickets yet, so thanks for clarifying!

#10 @boonebgorges
9 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

Thanks @flodit and @jutta0303!

This ticket was mentioned in Slack in #core by boone. View the logs.


9 years ago

Note: See TracTickets for help on using tickets.