After adding a new block and saving, going back to configure the block results in an empty form.
pg_query(): Query failed: ERROR: column reference "title" is ambiguous in /var/www/drupal/drupal-5.0-rc2/includes/database.pgsql.inc on line 125.
query: SELECT bx.*, title FROM boxes bx INNER JOIN blocks bl ON bx.bid = bl.delta WHERE module = 'block' AND bid = 5 in /var/www/drupal/drupal-5.0-rc2/includes/database.pgsql.inc on line 144.
Adding bl reference to "title" column in block_box_get() fixes this on my install.
# diff block.module.orig block.module
362c362
< return db_fetch_array(db_query("SELECT bx.*, title FROM {boxes} bx INNER JOIN {blocks} bl ON bx.bid = bl.delta WHERE module = 'block' AND bid = %d", $bid));
---
> return db_fetch_array(db_query("SELECT bx.*, bl.title FROM {boxes} bx INNER JOIN {blocks} bl ON bx.bid = bl.delta WHERE module = 'block' AND bid = %d", $bid));
Server
OS: Debian 3.1 (Sarge)
Web Server: Apache 2.0.54
PHP: 4.3.10
DB: Postgres 7.4.7
Drupal: 5.0rc2
Comments
Comment #1
ulyses commentedThe problem seems to still exist in Drupal 5.0 Release.
Server
OS: Windows XP SP2
Web Server: Apache 2.2.4
PHP: 5.2.0
DB: Postgres 8.2
Drupal: 5.0
Best regards,
John
Comment #2
mdixoncm commentedWe have just experienced this problem.
The issue can be resolved by changing line 362 to
I'll add this to a patch in a minute.
Comment #3
mdixoncm commentedPatch implemented ready for review
Comment #4
mdixoncm commentedThat last file didn't upload correctly ... this one should be ok
Comment #5
rdibble commentedI had get the same messages in drupal 5.1 on the site I'm working on....
* warning: pg_query() [function.pg-query]: Query failed: ERROR: column reference "title" is ambiguous LINE 1: SELECT bx.*, title FROM boxes bx INNER JOIN blocks bl ON bx.... ^ in /var/www/virtual-drake/drake-prod/includes/database.pgsql.inc on line 125.
* user warning: query: SELECT bx.*, title FROM boxes bx INNER JOIN blocks bl ON bx.bid = bl.delta WHERE module = 'block' AND bid = 1 in /var/www/virtual-drake/drake-prod/includes/database.pgsql.inc on line 144.
Thanks for the info on how to patch.
Comment #6
jpolt commentedThe same patch fixed it for me
Drupal 5.1
PostgreSQL 8.2
Comment #7
Zen commentedThat should be
bl.titlenotbx.title. It is the blocks table that has the title field and not the boxes table. Attached patch also adds missing aliases in other parts of the query.Please review and set to "Ready to be committed" if the attached patch works for you. I'm not sure how adding bx.title worked for anybody as that should have spat out an unknown field error.
FYI: I've tested this only on MySQL.
Thanks,
-K
Comment #8
Zen commentedP.S. The above patch applies on both 6 and 5 with offsets.
Comment #9
stormsweeper commentedThe cause here may be the drop column query in system.install isn't being executed in system_update_1006(). That was the case for me, although the rest of that update did go through (dropping the constraint, etc).
Comment #10
dries commentedAh, can you guys look at the drop-query too? Let's make sure we're fixing the problem at the right level, eh. :)
Comment #11
Zen commented@Dries: The pgSQL query in question appears to be OK. However, there were other inconsistencies with the syntax and I've created an issue for it: http://drupal.org/node/138556
http://drupal.org/node/132775 (a dupe) also has the same fix. Marking this RTBC.
-K
Comment #12
drewish commentedI'm getting the same error on MySQL and this patch corrects it.
Comment #13
drewish commentedJust for future searchers, I'm getting this error as a side effect of the query:
Comment #14
dries commentedCommitted to CVS HEAD. I think this needs to go into Drupal 5 too.
Comment #15
drummCommitted to 5.
Comment #16
drummComment #17
(not verified) commented