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

linuxpoet’s picture

Changing to:

if($node_link == false) {
$node_link = 'NULL';
}

Should do it.

mailleux’s picture

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.

scottprive’s picture

Assigned: Unassigned » scottprive
Status: Active » Postponed (maintainer needs more info)

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..

jvandervort’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

Recipe 5.x branch moved to unsupported.