Post by ocrich » Thu Nov 21, 2019 1:08 am

Hi,

Hopefully posting in the right place. I have noticed in the admin section if i go to Settings->Store settings (this is where i can set the logo and theme, turn on maintenance mode etc.).
If I make any change (or not) but press the save button it all saves successfully and the changes take effect.


However, if I check my oc_setting table in the SQL database the entries haven't been updated, they have been re-saved. Almost as if the table is truncated then a new INSERT INTO is called to add the settings. I have tried a fresh install and every time you click save the oc_setting table gets all the values inserted as opposed to updated. (My auto index for setting ID is now at over 3000 but i still only have a total of 247 entries).

I had intended to add my own settings in here but if it truncates or drops the table every time my setting wont persist.
I did a test add and my setting saves fine and works right up until i go to settings in admin and click save. My entries seems to be deleted due to whatever process the save button goes through either dropping or truncating the table before re inserting the settings from the admin page.

This is Open Cart 3.0.3.2 Hope the above makes sense, anyone able to help with what i need to change to get the settings to update as opposed to being reinserted?


Many Thanks

Newbie

Posts

Joined
Thu Nov 21, 2019 12:56 am

Post by letxobnav » Thu Nov 21, 2019 8:41 pm

yes, I believe this is the same behaviour reported for duplicate products etc, something with js/form submissions, there is a fix for this for common.js I believe, just search for it, discussed many times.
Normally you do not notice this in settings table as the logic first deletes the entries if they exist and then inserts them again, bad logic in itself but it does mean that the next time you save, those duplicates may be gone be it that the key just increased unnecessary.

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by ocrich » Thu Nov 21, 2019 9:38 pm

letxobnav wrote:
Thu Nov 21, 2019 8:41 pm
yes, I believe this is the same behaviour reported for duplicate products etc, something with js/form submissions, there is a fix for this for common.js I believe, just search for it, discussed many times.
Normally you do not notice this in settings table as the logic first deletes the entries if they exist and then inserts them again, bad logic in itself but it does mean that the next time you save, those duplicates may be gone be it that the key just increased unnecessary.
Hi,
Thank you very much indeed I will have a search for the common.js and the fix used there and see how I get on.

Very much appreciated

Newbie

Posts

Joined
Thu Nov 21, 2019 12:56 am
Who is online

Users browsing this forum: No registered users and 10 guests