Jump to:
| Project: | album photos |
| Version: | 6.x-2.0-beta5 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
I am using Drupal, the latest version, 6.4. I have loaded the album photos module, however, i noticed that when I upload an image, I receive the following error:
query: INSERT INTO drupal6_x_image (fid, pid, nid, uid, des, wid, num) VALUES (39, 30, 0, 1, '', 0,2) in /hsphere/local/home/svan9420/svantech.com/sites/all/modules/photos/photos.module on line 747.
Theres is also other errors, however, the main problem is that the drupal_x_image table contains a count field that has a NOT NULL constraint on it. This sql statement does not insert anything into the column count, and thus the query fails. As a temporary fix, I have allowed the collumn to accept null values to "make things work". However, I am not sure what the intended purpose of this field is and what ramifications it will have on the module and its functionality. Please advise as to how this field is being used.
Thanks,
Randall
Comments
#1
Additional error message provided:
pg_query(): Query failed: ERROR: null value in column "count" violates not-null constraint in /hsphere/local/home/svan9420/svantech.com/includes/database.pgsql.inc on line 138.
Forgot to mention that my hosting company still uses version 7.x of postgresql. Not sure if this has an impact or not.
#2
Generally I will avoid use any 'null' value in the database, because 'null' can make SQL join have results you might not wanted.
I will set 'no null' for the field but give it a default value like '0' or ''.
#3
Thanks for the reply. I agree with you it is probably better to set a value for the count field. That means rewriting the SQL.
INSERT INTO drupal6_x_image (fid, pid, nid, uid, des, wid, num) VALUES (39, 30, 0, 1, '', 0,2)
would become something like this:
INSERT INTO drupal6_x_image (fid, pid, nid, uid, des, wid, num,count) VALUES (39, 30, 0, 1, '', 0,2,0);
I have no problem updating code to make these changes happen, but shouldn't this be fixed in the main development tree?
Is this acceptable?
Thanks,
Randall
#4
sorry, I misread your last comment.
Thanks for making those changes.
Randall
#5
This is a problem, has been amended in beta6.
thank
#6
closing because this is most likely fixed in the current releases.