Make WordPress Core

Opened 5 years ago

Closed 4 years ago

Last modified 4 years ago

#51593 closed defect (bug) (duplicate)

Problem assigning tags

Reported by: colics's profile Colics Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.5.1
Component: Taxonomy Keywords:
Focuses: Cc:

Description

I've made tags with initial letters ...
So i have two tags "S" and "Š" (slug "s" and "s-2").
When I try to add the tag "Š" in the post, after I save the post WP, I tag "S" instead of "Š"?
Is this a mistake or how can I fix my problem by adding the tag I want?

The same problem is with letters

  • C, Č and Ć
  • Z and Ž

Change History (3)

#1 @Colics
5 years ago

Solution
in file wp-includes/taxonomy.php

function term_exists( $term, $taxonomy = , $parent = null ) {
...
change line
$orderby = 'ORDER BY t.term_id ASC';
with line
$orderby = 'ORDER BY CASE WHEN hex(t.name) = hex(%s) THEN 0 ELSE 1 END, t.term_id ASC';

How does this work?
If he finds 100% equal, return it to the first one, if not then still according to the second criterion, ie. t.term_id ASC

#2 @sabernhardt
4 years ago

  • Component changed from General to Taxonomy
  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

@Colics Thanks for suggesting a solution.

Please add that comment to the original ticket #47339 so all history for this issue stays on one ticket. I'll update the description there to match this one.

#3 @Colics
4 years ago

Is this planned to be done?

Note: See TracTickets for help on using tickets.