WordPress.org

Make WordPress Core

Opened 13 years ago

Closed 13 years ago

Last modified 3 years ago

#5240 closed defect (bug) (fixed)

taxonomy - incorrect query in update or insert term to increase term_group

Reported by: michelwp Owned by:
Milestone: 2.5 Priority: high
Severity: major Version: 2.3
Component: Administration Keywords: taxonomy term slug term_group alias_of needs-patch
Focuses: Cc:

Description

In both functions (wp_insert_term and wp_update_term, the SQL query - to increase the term_group when creating an alias of a term not yet in a term_group - is incorrect.

The query was

SELECT MAX(term_group) FROM $wpdb->terms GROUP BY term_group

but must be

SELECT MAX(term_group) FROM $wpdb->terms

GROUP BY is not here necessary !

(I am testing taxonomy.php script and features to create a multilingual dictionary of terms that can be used in themes or elsewhere)

About alias_of features : See also Trac #5230

Attachments (1)

taxonomy_diffs (2.0 KB) - added by michelwp 13 years ago.

Download all attachments as: .zip

Change History (4)

@michelwp
13 years ago

#1 @michelwp
13 years ago

Please find enclose the comparison of taxonomy in diff (I found a easy way to make it) between 2.3 original (_o) and the current running on our public test web site dev.xiligroup.com... (it is summary of #5230 and this one #5240).
Michel

#2 @ryan
13 years ago

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

(In [6285]) Remove unnecessary GROUP BY when getting max term_group. Props michelwp. fixes #5240

This ticket was mentioned in Slack in #core-media by antpb. View the logs.


3 years ago

Note: See TracTickets for help on using tickets.