Dirty Butter Posted June 19, 2015 Share Posted June 19, 2015 (edited) Twice today I cloned an existing product that DID have a manufacturer to create a product that did NOT have a known manufacturer. Everything worked as expected, except nothing I did would save the NONE as manufacturer. It continued to revert to the manufacturer from the cloned item. I had to go to phpMyAdmin to change the manufacturer code back to zero in the inventory table.Could someone please test this in your store to see if this is a bug or not? If it is a bug, I wonder how far back it's been there... Edited June 19, 2015 by Dirty Butter Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 19, 2015 Share Posted June 19, 2015 I can confirm. Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 19, 2015 Share Posted June 19, 2015 In the admin skin template products.index.php, near line 151, find: <select name="manufacturer" id="manufacturer" class="textbox" type="text"> <option value="">{$LANG.form.none}</option> {foreach from=$MANUFACTURERS item=manufacturer} <option value="{$manufacturer.id}"{$manufacturer.selected}>{$manufacturer.name}</option> {/foreach} </select> Change this line:<option value="">{$LANG.form.none}</option>To be like this:<option value="0">{$LANG.form.none}</option>The cause of the problem is that there is code to remove data from the product array being POSTed that has been shown to cause errors with certain database server configurations if that data is blank. (This was an issue since CC3 because CubeCart was never coded to work with a MySQL database configured for "strict" mode. Now, from since the latest versions of CC5, a command is sent to the database to force it out of strict mode.)So, a test is made and these certain data elements are removed if they are blank, null, an empty array, etc, but will keep them if they are '0' or '0.0'.So, the fix is to make the "--None--" choice of manufacturer be '0' and not blank. A manufacturer "id" of zero is a valid value to represent "no such related record in database'. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted June 19, 2015 Author Share Posted June 19, 2015 Thanks for confirming!https://github.com/cubecart/v6/issues/627 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.