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.
there is a tiny problem in translation.module in
translation_node_nid(...)
the sql string doesn't work with pgsql.
Inspite of using
'AND n.trid'
it'd be better to use
'AND n.trid is not null'
I replaced all the != with <> for compatibility as well.
Comment | File | Size | Author |
---|---|---|---|
#6 | i18n.translation.module.20090211.patch | 1.51 KB | ekes |
#3 | i18n.patch | 3 KB | ivanSB@drupal.org |
#2 | i18n.patch | 3 KB | ivanSB@drupal.org |
Comments
Comment #1
Jose Reyero CreditAttribution: Jose Reyero commentedI'm not developing nor testing with pgsql so all fixes are welcomed.
But it seems you forgot to post the patch!
Comment #2
ivanSB@drupal.orgI just upgraded to 5.x-2.2 from 5.x-2.1 to test the patch on a newer version. Everything went smooth, no db change were required... and this is the patch...
I changed all the != to <>. Up to my knowledge while != is supported by pg too it is not part of sql92 standard. I wouldn't bet on it, but the change shouldn't (actually doesn't) hurt at all.
There are many != all around other files in the package... but since they didn't hurt for pg.... they are still there.
Comment #3
ivanSB@drupal.orgJust updated to fix security problems and the issue is still there.
Here is the patch... same changes as before.
Comment #4
Jose Reyero CreditAttribution: Jose Reyero commentedThanks
Comment #5
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #6
ekes CreditAttribution: ekes commentedThis patch added:
AND n.trid is not null
however the trid column in the tables {i18n_node} and {term_node} aretrid int(10) unsigned NOT NULL default '0'
. I guess that previously was relying on n.trid not being NULL or 0, because now the query joins trid n.trid 0 = a.trid 0 when there is no translation and returns a whole bunch of rows quite incorrectly.Suggest replacing the line with for example for translation_node_nid:-
$translation = db_result(db_query("SELECT n.nid FROM {i18n_node} n INNER JOIN {i18n_node} a ON n.trid = a.trid AND n.nid <> a.nid WHERE a.nid = %d AND n.language = '%s' AND n.trid > 0", $nid, $language ? $language : i18n_get_lang()));
I'm having a problem with cvs connection so a patch rolled against two local copies of translation.module on my machine is attached.
Comment #7
R.Hendel CreditAttribution: R.Hendel commentedDeprecated - D5 is no longer supported.