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.
Hi,
I had some problem to make this module run with Postgres 7.4
It seems the version of Postgres that I'm using is not possible to use double quotes (") in the queries to specify a language.
with the original code, for example...
languageinterface.module
...
(195) $defaulttext = db_result(db_query('SELECT native FROM {languages} WHERE language = "%s"', $lang));
...
It was giving some warnings...
# warning: pg_query(): Query failed: ERROR: column "en" does not exist in c:\...\includes\database.pgsql.inc on line 139.
# user warning: query: SELECT native FROM languages WHERE language = "en" in c:\...\sites\all\modules\languageinterface\languageinterface.module on line 195.
Changing the double quotes for simple quotes might solve the problem (at least for me)
languageinterface.module
...
(195) $defaulttext = db_result(db_query('SELECT native FROM {languages} WHERE language = \'%s\'', $lang));
...
hope it helps someone :)
Comment | File | Size | Author |
---|---|---|---|
#6 | 385526.patch | 1.23 KB | Jolidog |
Comments
Comment #1
PixelClever CreditAttribution: PixelClever commentedComment #3
testosterone_z CreditAttribution: testosterone_z commentedThe MySQL-specific SQL statements still persist in Version 6.x-2.3.
In file "languageinterface.module", lines 344, 351 and 442. "%s" should get replaced by \'%s\' (escaped single quotes) or the statements should get wrapped with double quotes and the %s with single quotes.
Thanks in advance.
Comment #4
testosterone_z CreditAttribution: testosterone_z commentedComment #5
testosterone_z CreditAttribution: testosterone_z commentedComment #6
Jolidog CreditAttribution: Jolidog commentedChanged the lines indicated by testosterone_z to statements wrapped with double quotes and the %s with single quotes.
I can't test this with Postgres, so someone who can, please report back.
Thanks