Closed (fixed)
Project:
Ubercart Option Images
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
27 Apr 2011 at 23:38 UTC
Updated:
7 Jul 2011 at 20:11 UTC
I installed 6.x.1.x-dev today on a site that uses PostgreSQL. I got an error from PostgreSQL complaining about using a character varying as a boolean on uc_option_image.install line 10:
$file_path = db_result(db_query("SELECT fid from {files} WHERE filename = '%s'
AND filepath", $default_image_name, $default_image_path));
I at first thought perhaps this was intended to look for a non-blank filepath, but then I spotted the $default_image_path at the end. I think the second part of the conditional was intended to be "AND filepath = '%'". I'll guess it hasn't been caught because most people use MySQL, and probably MySQL *does* let you use a char varying as a boolean. Patch attached.
| Comment | File | Size | Author |
|---|---|---|---|
| uc_option_image.install-6.x-1.x-dev.patch | 751 bytes | ben coleman |
Comments
Comment #1
ben coleman commentedComment #2
ben coleman commentedComment #3
ben coleman commentedAny comments on this? I don't think this is just a PostgreSQL compability problem. I don't think the above code does whatever was intended. Either the $default_image_path parameter should have been left off, or filepath is supposed to be compared to it somehow. And given that the equivalent query in uc_option_image_uninstall *does* show the comparison:
db_query("DELETE FROM {files} WHERE filename = '%s' AND filepath = '%s'", $default_image_name, $default_image_path);
I'd say the comparison should be there.
Comment #4
pillarsdotnet commentedPatch applied to -dev.