Page 1 of 1

Fatal Error

Posted: Fri May 26, 2017 9:39 pm
by MAD King
Hello,

I installed two fresh OC 2.3.0.2 and every time I try to add a product I get this error.
The only module I have installed is Product Color Option

https://www.opencart.com/index.php?rout ... on_id=6907

and I am not sure if this is related to this. Contacted the module developer several times, no response.
Very frustrating.

--
Fatal error: Uncaught Exception: Error: Unknown column 'image_product_option_value' in 'field list'<br />Error No: 1054<br />INSERT INTO oc_product_option_value SET product_option_value_id = '0', product_option_id = '228', product_id = '50', option_id = '13', option_value_id = '49', quantity = '10', subtract = '1', price = '0', price_prefix = '+', points = '0', points_prefix = '+', weight = '0', weight_prefix = '+',image_product_option_value = '' in /home/public_html/opencart-test/system/library/db/mysqli.php:40 Stack trace: #0 /home/public_html/opencart-test/system/library/db.php(16): DB\MySQLi->query('INSERT INTO oc_...', Array) #1 /home/public_html/opencart-test/vqmod/vqcache/vq2-admin_model_catalog_product.php(193): DB->query('INSERT INTO oc_...') #2 /home/public_html/opencart-test/vqmod/vqcache/vq2-system_engine_loader.php(178): ModelCatalogProduct->editProduct('50', Array) #3 /home/public_html/ in /home/public_html/opencart-test/system/library/db/mysqli.php on line 40
--


If this is not a bug, but module related, please move my topic to the appropriate forum.

Thanks

Re: Fatal Error

Posted: Sat May 27, 2017 7:44 pm
by IP_CAM
Well, your problem is sure related to the Extension you bought:
image_product_option_value
INSERT INTO oc_product_option_value SET product_option_value_id

but I assume, it's looking for a seemengly non-existent DataBase Section.
So, make sure, to have the extension installed, as it probably should, to make this work.
And if you use a Custom Theme, you have good chances, that it will not work, before beeing
matched to such a Custom Theme.
Good Luck
Ernie

Re: Fatal Error

Posted: Sat May 27, 2017 9:10 pm
by MrPhil
Interesting. Is INSERT INTO now allowed to use SET instead of a VALUES list? I've always seen SET used with UPDATE. Is this a recent change to MySQL? Perhaps it doesn't work on your server's version.

Edit: Note to developers: INSERT INTO ... SET is a MySQL-unique syntax. This will cause portability problems if you ever want to support other databases. You really should be using INSERT INTO ... VALUES, which is standard SQL.

Re: Fatal Error

Posted: Sat May 27, 2017 11:04 pm
by oclcas
@MrPhil - the error doesnt' appear related to the SQL Syntax at all, but rather that the extension didn't create the column it needs in the database.

To OP - I would examine the module a little bit and see if you can determine what column type it wants `oc_product_option_value.,image_product_option_value` to be (INT or VARCHAR most likely)?