When clicking the Revisions tab of any of my custom blocks in order to restore a revision, I get:
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'vid' in field list is ambiguous: SELECT vid, body, format, br.timestamp, br.log, u.uid, u.name FROM {boxes_revisions} br LEFT JOIN {users} u ON br.uid = u.uid WHERE br.bid = :bid ORDER BY timestamp DESC; Array ( [:bid] => 18 ) in block_revision_list() (line 149 of /home/mysampleuser/public_html/sites/all/modules/block_revisions/block_revisions.admin.inc).
"vid" exists in both the boxes_revisions and users tables, hence the ambiguity.
Working on a patch.
Maybe it should be:
SELECT br.vid, body, format, br.timestamp, br.log, u.uid, u.name FROM {boxes_revisions} br LEFT JOIN {users} u ON br.uid = u.uid WHERE br.bid = :bid ORDER BY timestamp DESC;
I tried this out in phpMyAdmin and it worked there...
Comments
Comment #1
caspervoogt commentedHere's the patch.
Comment #2
dmitrit commentedCommited.
Comment #4
caspervoogt commentedI encountered a very similar error when click "Revert", but on line 52 of block_revisions.module.
Changed this:
$query = 'SELECT bid, vid, body, format, br.timestamp, br.log, u.uid, u.name FROM {boxes_revisions} br LEFT JOIN {users} u ON br.uid = u.uid WHERE br.bid = :bid AND br.vid = :vid';to this:
$query = 'SELECT bid, br.vid, body, format, br.timestamp, br.log, u.uid, u.name FROM {boxes_revisions} br LEFT JOIN {users} u ON br.uid = u.uid WHERE br.bid = :bid AND br.vid = :vid';That solved it for me.
Comment #5
caspervoogt commentedComment #6
caspervoogt commentedsee patch above. This solved it on my end.
Comment #7
caspervoogt commentedComment #9
dmitrit commented