Yeah, "back then", the code simply assigned a "quoted" version of whatever the result for $v_tax_class_id was. In this case, a value of zero, false, or null would result in a pair of empty single quotes. Also "back then", databases would convert this to either an empty value if the field supported it or as should have been the case to convert it to the number type associated to the field. The products_tax_class_id is an integer, so again "back then" it would change that "empty" to a zero and store the zero. Now though (because of whatever background change that occurred at some point) the system reports an error rather than do the conversion.
So, if were #@!! bent on continuing to use that version, search for:
Code:
products_tax_class_id = '".$v_tax_class_id."',
And replace with:
Code:
products_tax_class_id = '".(int)$v_tax_class_id."',
In two places.
But... there are a lot of other fields that were populated that way and would cause a problem too and need either similar updates or better yet, upgrade of the software which doesn't suffer that issue.
Bookmarks