Posted by mailleux on November 6, 2007 at 4:52pm
Jump to:
| Project: | Recipe |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | tzoscott |
| Status: | closed (won't fix) |
Issue Summary
With the link column in place the inserting of ingredients fails on postgres. This is due to the fact that is no node is found, the value that is inserted is '' (blank), which is not a valid number. I did a quick fix by adding this after line 575 of recipe.module:
if($node_link === false) {
$node_link = 0;
}This makes any not found nodes a link to 0. But this is not really the way to do this. Either this columns allows null, and there has to be a code change for this. O it is set as a text (varchar) column, in which case the blank value is a valid not null column.
I believe the best way is to insert null if there is no link. This makes sure the data is correct, but avoid breaking on Postgres.
Comments
#1
Changing to:
if($node_link == false) {
$node_link = 'NULL';
}
Should do it.
#2
This is already the value in the case. The problem is that null will be converted into a an empty string on postgres (
''). This is not a valid number, thus if fail. Now if we set it to zero, it works fine. Now if the column should accept null or a number, they should no be place in within quotes, and should be formatted either as NULL or the number.#3
Can you retry this using CVS HEAD? There was a Postgres bugfix just checked in regarding the ingredients link.. might be the same issue but solved a different way. Let me know thanks..
#4
Recipe 5.x branch moved to unsupported.