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.
Hello , I got the following error
Path
advanced-book-blocks/configure/0
Error message
user warning: Unknown column 'b.module' in 'on clause' query: SELECT mlid FROM book b LEFT JOIN i18n_blocks i18n ON (b.module = i18n.module AND b.delta = i18n.delta) WHERE (i18n.language ='en' OR i18n.language ='' OR i18n.language IS NULL) AND ( b.bid = 102 AND b.nid = b.bid) in /home/shefaya/public_html/sites/all/modules/advancedbookblocks/advancedbookblocks.module on line 194.
Any help ?
Comments
Comment #1
Majdi CreditAttribution: Majdi commentedAfter I took a look at the module ,
in line 194 we have
$mlid = db_result(db_query(db_rewrite_sql("SELECT mlid FROM {book} b WHERE b.bid = %d AND b.nid = b.bid","b","bid"), $bid));
I replace it with
$mlid = db_result(db_query(db_rewrite_sql("SELECT mlid FROM {book} b WHERE b.bid = %d AND b.nid = b.bid","{book}","bid"), $bid));
Any idea why is that ?
Thanks
Comment #2
PixelClever CreditAttribution: PixelClever commentedI can't reproduce this. Deleting the alias doesn't seem like a good idea. Perhaps the mlid needs an alias in front of it? Try this:
Comment #3
Majdi CreditAttribution: Majdi commentedI add the line
after i add it I got the following error
Comment #4
YanBoudreau CreditAttribution: YanBoudreau commentedI replaced that line and the module is now working:
$mlid = db_result(db_query(db_rewrite_sql("SELECT mlid FROM {book} WHERE book.bid = %d AND book.nid = bid","book","bid"), $bid));
Comment #5
HansKuiters CreditAttribution: HansKuiters commented@YanBoudreau: you replaced the alias with 'book'. Is that a good idea?
It seems that i18n is causing the problems. I had this working without the errors in a testsite which didn't had i18n installed.After some testing: changing the alias 'b' to 'book' solves the errors. So there might be a problem with using the alias 'b'.
My changes to #194:
Comment #6
jvieille CreditAttribution: jvieille commentedI had this error, using i18n.
#5 fix it.
Comment #7
jvieille CreditAttribution: jvieille commented