We ran into a bug where signwriter profiles could not be saved in certain circumstances because of a MySQL UPDATE error. After digging into the code, I found the error came about because the UPDATE statement tried to set INTEGER columns to a zero string value (ie. UPDATE table SET digit="";) It appears both the INSERT and UPDATE statements are passed all field data as strings using the %s modifier, instead of using the %d modifier for integers.

Currently an update query looks something like this:

db_query('UPDATE table SET number="%s", text="%s"', $number, $text);

But it should look like this:

db_query('UPDATE table SET number=%d, text="%s"', $number, $text);

I have provided the attached patch which will specify the data types of each profile field. The patch is against the 5.x-1.5 version.

CommentFileSizeAuthor
signwriter-db-modifiers.patch3.78 KBnrambeck

Comments

agileware’s picture

Thanks for picking this up.

The D6 version had already addressed this so I will bring the change to the 5 version too.

duaelfr’s picture

Status: Needs review » Closed (won't fix)

This version of Signwriter is not supported anymore. The issue is closed for this reason.
Please upgrade to a supported version and feel free to reopen the issue on the new version if applicable.

This issue has been automagically closed by a script.