Fix for MariaDB re Issue #119#147
Closed
alexgw wants to merge 2 commits into
Closed
Conversation
puikinsh
added a commit
that referenced
this pull request
Jun 2, 2026
…dering - Fix post order being scrambled on MariaDB / MySQL 8 when menu_order is re-normalized after gaps appear: refresh() now re-numbers deterministically in PHP instead of via a MySQL user-variable (@row_number) ranking whose evaluation order is undefined on those databases. Props @alexgw and @sebastiencyr (#147, #119). - Honor `orderby=include` in get_terms() / wp_get_object_terms() instead of overriding it with the custom term order; the term filters now receive $args. Props @glebkema (#67, #66). - Apply custom term ordering when any queried taxonomy is sortable (not only the first) and keep the caller's orderby as a fallback tiebreaker. Props @goaround (#104). No asset or data-format changes; fully backward compatible with 2.7.0. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Member
|
Thank you @alexgw — and @sebastiencyr for the original analysis on #119! 🙏 You were right: This is fixed in 2.7.1 (just released to WordPress.org). Rather than the $ordered_ids = $wpdb->get_col( $wpdb->prepare(
"SELECT ID FROM $wpdb->posts
WHERE post_type = %s AND post_status IN ('publish','pending','draft','private','future')
ORDER BY menu_order ASC",
$object
) );
foreach ( $ordered_ids as $position => $id ) {
$wpdb->update( $wpdb->posts, [ 'menu_order' => $position + 1 ], [ 'ID' => (int) $id ] );
}You're both credited in the changelog. Closing as resolved in 2.7.1 — thanks again for chasing this down! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As suggested by https://github.com/sebastiencyr on #119