Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The taxonomy 'Reset to alphabetical fails in postgresql because postgres doesn't use table aliases for UPDATE statements.
Patch attached.
Comment | File | Size | Author |
---|---|---|---|
#18 | 323528_d6.patch | 1.12 KB | andypost |
#10 | 323528.patch | 2.56 KB | jhedstrom |
#7 | 323528.patch | 2.58 KB | jhedstrom |
#5 | 323528.patch | 2.58 KB | jhedstrom |
0001-Core-Taxonomy-Fix-Reset-to-alphabetical-admin-fu.patch | 992 bytes | halcyonCorsair | |
Comments
Comment #1
halcyonCorsair CreditAttribution: halcyonCorsair commentedSet status to patch -> code needs review.
Comment #2
Damien Tournoud CreditAttribution: Damien Tournoud commentedThis will need to be fixed in HEAD first (D7-dev), then backported. Also promoted to the PostgreSQL surge (see #337146: Remove PostgreSQL driver from core for more context).
Comment #4
Damien Tournoud CreditAttribution: Damien Tournoud commentedIn Drupal 7, we still have those:
./modules/system/system.install: db_query('UPDATE {term_node} t SET vid = (SELECT vid FROM {node} n WHERE t.nid = n.nid)');
./modules/system/system.install: $ret[] = update_sql("UPDATE {poll_votes} v SET chid = (SELECT chid FROM {poll_choices} c WHERE v.chorder = c.chorder AND v.nid = c.nid)");
./modules/taxonomy/taxonomy.admin.inc: db_query('UPDATE {term_data} t SET weight = 0 WHERE vid = :vid', array(':vid' => $form_state['values']['vid']));
Let's fix them and move that issue quickly to D6.
Comment #5
jhedstromPatch attached that removes the aliases in the 3 queries mentioned in #4.
Not all tests pass (due to other issues), but the number of fails doesn't change pre/post patch...we'll see how the testbot likes this.
Comment #6
CalebD CreditAttribution: CalebD commentedLooks like there is an extra curly brace in the query: {poll_choices}}.chorder
+ $ret[] = update_sql("UPDATE {poll_votes} SET chid = (SELECT chid FROM {poll_choices} WHERE {poll_vodes}.chorder = {poll_choices}}.chorder AND {poll_votes}.nid = {poll_choices}.nid)");
Comment #7
jhedstromExtra curly brace removed. Thanks.
Comment #8
Damien Tournoud CreditAttribution: Damien Tournoud commentedI'm pretty sure we can keep the alias on {node}.
{poll_vodes}? Also please keep the alias on {poll_choices}.
Comment #9
Damien Tournoud CreditAttribution: Damien Tournoud commentedComment #10
jhedstromvodes...oops.
Fixes attached.
Comment #11
Damien Tournoud CreditAttribution: Damien Tournoud commentedPerfect. Many thanks Jonathan.
Comment #12
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks.
Comment #13
Dave ReidMoving to 6.x to be ported.
Comment #14
c960657 CreditAttribution: c960657 commentedIt looks like the patch in #348448: Always report E_STRICT errors was accidentially committed together with the fix for this issue:
http://drupal.org/cvs?commit=159769
The patch in #348448 still applies using
patch -R
.Comment #15
Damien Tournoud CreditAttribution: Damien Tournoud commentedWe are now working on D6. There are potentially more queries to convert, it's not a simple backport.
Comment #16
Damien Tournoud CreditAttribution: Damien Tournoud commentedIn fact, I only see two of them:
./modules/system/system.install: db_query('UPDATE {term_node} t SET vid = (SELECT vid FROM {node} n WHERE t.nid = n.nid)');
./modules/taxonomy/taxonomy.admin.inc: db_query('UPDATE {term_data} t SET weight = 0 WHERE vid = %d', $form_state['values']['vid']);
Comment #17
Damien Tournoud CreditAttribution: Damien Tournoud commentedComment #18
andypostonly one place
Comment #19
c960657 CreditAttribution: c960657 commentedI couldn't find more than that single occurrence either.
Comment #20
Gábor HojtsyLooks good, thanks, committed.