I installed drupal, for Multiple user, but warning error is show up :
* warning: pg_query() [function.pg-query]: Query failed: ERROR: invalid input syntax for integer: "" in /home/xxx/drupal-6.8/includes/database.pgsql.inc on line 139.
* user warning: query: SELECT n.nid, n.type, n.language, n.uid, n.status, n.created, n.changed, n.comment, n.promote, n.moderate, n.sticky, n.tnid, n.translate, r.vid, r.uid AS revision_uid, r.title, r.body, r.teaser, r.log, r.timestamp AS revision_timestamp, r.format, u.name, u.picture, u.data FROM node n INNER JOIN users u ON u.uid = n.uid INNER JOIN node_revisions r ON r.vid = n.vid WHERE n.nid = '' in /home/xxx/drupal-6.8/modules/node/node.module on line 749.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | pgsql-warning-at-node.patch | 737 bytes | beginner |
Comments
Comment #1
wa2nlinux commentedComment #2
wa2nlinux commentederror show up when I install blogtheme
Comment #3
wa2nlinux commentedComment #4
beginner commentedI'll try to have a look at this issue soon. Do you have a suggested fix?
Comment #5
wa2nlinux commentedYes .. I did not know about drupal code ( newbie in here :D )
but I know little bit know about php and postgreSQL.
I hacked node.module ( I dunno this is wise option or not :D ), now the error warning is gone.
I add simple code to replace null value with 0.
I suggest this because I used PostgreSQL not Mysql and they have different way to look at null value.
Comment #6
beginner commentedblogtheme does not have a single SQL query, so this module cannot be responsible.
Hacking Drupal core is never a wise thing to do ;) Be careful!
Could you investigate the issue further and reassign this issue to the proper module?
Comment #7
wa2nlinux commentedOk, ... I'll try to learn on it :D ..
Found it !! on case "node"
the if $nid value is_null then Prostgres don't like it, because it ilegal !!, nid is INT NOT NULL, so I add checking not null value for $nid if yes give it 0 instead not hull.
Here portion of blog_theme.module, I add smal code on below $nid = arg(1)
case 'node':
Comment #8
wa2nlinux commentedComment #9
beginner commentedThanks for investigating the problem and finding the cause. It's very helpful.
Node $nid = 0 does not exist. If $nid is NULL then there is no reason to proceed. Try the attached patch, instead.
See this: http://drupal.org/patch
Since you say you are a newbie with Drupal, here are a couple of advice which will help you to communicate better with module maintainers:
1) On an issue, edit your own comment only to fix typos. Add additional information in a new comment. The practical reason for this is that we are subscribed to the issue and receive email notifications. In this case, the email I received when you posted #7, only had the text
Ok, ... I'll try to learn on it :D ... If you hadn't posted #8, I wouldn't have come back online and wouldn't have seen the additional very useful and relevant information.2) In your original report, there is one key information missing: how to reproduce the bug. It is always VERY helpful to have a step by step instructions to reproduce the bug. It helps to find which part of the code is involved.
The attached patch should solve the issue. Thanks for the feedback.
Comment #10
wa2nlinux commentedOK thanks for advices :D
At first post I dunno what causing error I enabled many modules, after that I try to check it one by one. So I post the #2.
Thanks
Comment #11
beginner commentedDon't close yet. I haven't committed the fix.
Comment #12
wa2nlinux commentedSomething wrong ?
blog@wwwserv2:~/web$ patch -p0 < pgsql-warning-at-node.patch
can't find file to patch at input line 8
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: blog_theme.module
|===================================================================
|RCS file: /cvs/drupal-contrib/contributions/modules/blogtheme/blog_theme.module,v
|retrieving revision 1.20.2.8
|diff -u -p -r1.20.2.8 blog_theme.module
|--- blog_theme.module 30 Sep 2008 08:58:26 -0000 1.20.2.8
|+++ blog_theme.module 6 Jan 2009 13:20:14 -0000
--------------------------
File to patch:
Comment #13
wa2nlinux commentedOk done, The patch must on module directory, cannot do on drupal root directory, the problem was fix using your patch :D. Here the web, http://blog.akprind.ac.id,
Comment #14
beginner commentedThanks for the feedback.
Usually Drupal core patches are applied from the Drupal root directory, but contrib module patches are applied from within their own directory.
I have committed the fix in HEAD and D6. D5 didn't need this.
I'll set this issue as fixed when I have made a new release: #355440: Make new D5 and D6 releases.