Hi, I dont belive this module supports PG. here is the errors upon creating a new book block.



    * warning: pg_query() [function.pg-query]: Query failed: ERROR: null value in column "custom" violates not-null constraint in /var/www/sparcs/includes/database.pgsql.inc on line 139.
    * user warning: query: INSERT INTO adv_book_block (delta, title) VALUES (1, 'Sparcs User Guide') in /var/www/sparcs/sites/all/modules/advancedbookblocks/advancedbookblocks.module on line 117.
    * warning: pg_query() [function.pg-query]: Query failed: ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list in /var/www/sparcs/includes/database.pgsql.inc on line 139.
    * user warning: query: SELECT DISTINCT b.bid FROM book b, menu_links m WHERE m.mlid = b.mlid ORDER BY m.weight ASC in /var/www/sparcs/sites/all/modules/advancedbookblocks/advancedbookblocks.module on line 444.
    * warning: pg_query() [function.pg-query]: Query failed: ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list in /var/www/sparcs/includes/database.pgsql.inc on line 139.
    * user warning: query: SELECT DISTINCT b.bid FROM book b, menu_links m WHERE m.mlid = b.mlid ORDER BY m.weight ASC in /var/www/sparcs/sites/all/modules/advancedbookblocks/advancedbookblocks.module on line 444.
    * warning: Invalid argument supplied for foreach() in /var/www/sparcs/sites/all/modules/advancedbookblocks/advancedbookblocks.module on line 160.
    * warning: Invalid argument supplied for foreach() in /var/www/sparcs/sites/all/modules/advancedbookblocks/advancedbookblocks.module on line 284.

CommentFileSizeAuthor
#3 advancedbook.diff720 byteslamigo

Comments

VeeLin’s picture

+1

PixelClever’s picture

Status: Active » Postponed (maintainer needs more info)

I don't use postgre and I don't have time to set up a server just for one bug. However if you post a patch and the community test it I will apply it. I fixed one part of the error that seemed fairly clear in the upcoming 1.4 release, but I don't know what they mean about the order by issue.

lamigo’s picture

StatusFileSize
new720 bytes

Here is a small patch to fix query error on 6.x-1.5

PixelClever’s picture

Status: Postponed (maintainer needs more info) » Needs review

Does this patch work for everyone else? Since I don't have time to test postgre I will be depending on your feed back to determine if this is sufficient or if more needs to be done.

lamigo’s picture

Error is trivial, postgres is very "pedant" or "strict" as you wish to call it and don´t let you order by a field that is not on select clause, that's the only content on the patch, adding order clauses to select fields, this is clean for both postgres and mysql.

PixelClever’s picture

Status: Needs review » Patch (to be ported)

My only concern was that this patch doesn't address all of the order by clauses in the module. There were several other places where the field in the order by clause wasn't in the select. I have changed the rest that I found on my development installation and committed it to HEAD. If no one finds any problems then I will include it in the next official release.

PixelClever’s picture

Status: Patch (to be ported) » Fixed

This should be fixed in the 1.6 release. I applied the patch and made several other changes to queries that seemed to have the same pattern. Let me know if you see this problem still.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.