Incompatability with PostgreSQL 8.3
| Project: | footermap: a footer site map |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | patch (to be ported) |
Jump to:
PostgreSQL 8.3 removed a lot of implicit casts. After enabling the footermap module, Drupal always returns a blank page. The Apache error log is empty (PHP logging is not enabled, but it would probably show this).
If the footermap module directory is removed, the following errors are displayed:
* warning: pg_query() [function.pg-query]: Query failed: ERROR: operator does not exist: text = integer at character 114 HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts. in /var/www/html/drupal/includes/database.pgsql.inc on line 139.
* user warning: query: SELECT ml.*, coalesce(n.status,1) as nstatus FROM menu_links ml LEFT OUTER JOIN node n ON substr(ml.link_path,6) = n.nid WHERE ml.plid = 0 AND ml.module <> 'system' AND ml.hidden <> -1 ORDER BY ml.plid,ml.weight in /var/www/html/drupal/sites/default/modules/footermap/footermap.module on line 180.
To fix, change the query:
SELECT ml.*, coalesce(n.status,1) as nstatus FROM menu_links ml LEFT OUTER JOIN node n ON substr(ml.link_path,6)::integer = n.nid WHERE ml.plid = 0 AND ml.module <> 'system' AND ml.hidden <> -1 ORDER BY ml.plid,ml.weight
The explicit ::integer resolves the issue. Whether it is cross-platform for MySQL etc is unknown.

#1
Whoops, my bad. I should have known better really. I was trying to keep things as db-neutral as possible, but it looks like I'll have to split the queries :(.
More incentive to investigate dropping it all together and doing things with cache and php instead I guess.
Thanks.
I committed to the dev version, which should update sometime later today or tomorrow.
#2
This is still an issue.
#3
Should be working now.