Incompatability with PostgreSQL 8.3

cricalix - March 18, 2009 - 15:16
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)
Description

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

mradcliffe - March 18, 2009 - 15:45
Status:active» patch (to be ported)

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

mradcliffe - April 30, 2009 - 16:52
Status:patch (to be ported)» needs work

This is still an issue.

#3

mradcliffe - May 21, 2009 - 03:22
Version:6.x-1.5» 6.x-1.x-dev
Status:needs work» patch (to be ported)

Should be working now.

 
 

Drupal is a registered trademark of Dries Buytaert.