Closed (won't fix)
Project:
Recipe
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
6 Nov 2007 at 16:52 UTC
Updated:
21 Oct 2011 at 21:06 UTC
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
Comment #1
linuxpoet commentedChanging to:
if($node_link == false) {
$node_link = 'NULL';
}
Should do it.
Comment #2
mailleux commentedThis 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.Comment #3
scottprive commentedCan 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..
Comment #4
jvandervort commentedRecipe 5.x branch moved to unsupported.