Page 1 of 1

RESOLVED - Fatal Error occuring when trying to save options using SELECT (existing options deleted)

Posted: Sun Feb 18, 2018 9:35 pm
by Mountune
Hello,

I recently purchased this extension from the opencart marketplace ( https://www.opencart.com/index.php?rout ... n_id=31196 however I seem to be having issues.

I had to install VQmod to get this extension to work and it does work in terms of allowing me to set minimum and maximum character lengths using TEXT and TEXTAREA options.

The issue I have is that all my existing options using SELECT have had their sub-options deleted and when trying to re-add them or add ac completely new option with SELECT I get the following error:

Image
------------------------------------------------------------------------------------------------------------------------------------------------
EDIT - For some reason the image is silly small once uploaded so here is a copy of the text;
------------------------------------------------------------------------------------------------------------------------------------------------
Fatal error: Uncaught Exception: Error: Unknown column 'o_min' in 'field list'<br />Error No: 1054<br />INSERT INTO oc_option_value_description SET option_value_id = '255', language_id = '1', option_id = '235', name = '1', o_min = '0', o_max = '0' in /shop/system/library/db/mysqli.php:40

Stack trace:
#0 /shop/system/library/db.php(16): DB\MySQLi->query('INSERT INTO oc_...', Array)
#1 /shop/vqmod/vqcache/vq2-admin_model_catalog_option.php(62): DB->query('INSERT INTO oc_...')
#2 /shop/vqmod/vqcache/vq2-system_storage_modification_system_engine_loader.php(178): ModelCatalogOption->editOption('235', Array)
#3 /shop/system/library/db/mysqli.php on line 40
------------------------------------------------------------------------------------------------------------------------------------------------

The error on line 40 (assuming its just 40 down key arrows) show the text - " return $result; ".

I'm not an expert in coding and I have tried changing the modified simpleone theme I am using back to default to see if the error still remains, which it does.

I can still add and save TEXT and TEXTAREA options but I cant get SELECT options to work.

I am using opencart version 2.3.0.2 and I don't have a test server

Here is an example of an option I am trying to save before the error appears;
Image

Thanks

Re: Fatal Error occuring when trying to save options using SELECT (existing options deleted)

Posted: Sun Feb 18, 2018 10:42 pm
by MrPhil
As part of installing this, were you supposed to manually update the oc_option_value_description table to include fields o_min and o_max? If it was to be automatically done, did it get done? Check with phpMyAdmin to browse around the database. It sounds like at least o_min is missing from the table.

Re: Fatal Error occuring when trying to save options using SELECT (existing options deleted)

Posted: Mon Feb 19, 2018 6:17 pm
by Mountune
Hello MrPhil,

I checked the database and both oc_options_description o_min and o_max are set to INT3

Re: Fatal Error occuring when trying to save options using SELECT (existing options deleted)

Posted: Mon Feb 19, 2018 6:45 pm
by paulfeakins
Mountune wrote:
Sun Feb 18, 2018 9:35 pm
I have contacted the owner of the extension but he keeps asking for FTP access which concerns me as I don't really want strangers accessing My FTP as they could do all sorts of damage and cause me more issues so I want to refrain from doing that.
Take a backup or provide the developer with access to a copy of the site, problem solved.

Re: Fatal Error occuring when trying to save options using SELECT (existing options deleted)

Posted: Tue Feb 20, 2018 1:04 am
by Mountune
what is the best way to make a backup to then make a working copy of opencart on my computer?

I don't believe handing over FTP to strangers is the best thing in terms of security.

Re: Fatal Error occuring when trying to save options using SELECT (existing options deleted)

Posted: Tue Feb 20, 2018 1:07 am
by paulfeakins
Mountune wrote:
Tue Feb 20, 2018 1:04 am
what is the best way to make a backup to then make a working copy of opencart on my computer?
Don't make it on your computer. Make it on your hosting. You must have a web developer who could do this for you? Some web hosts would even do this.

Re: Fatal Error occuring when trying to save options using SELECT (existing options deleted)

Posted: Wed Feb 21, 2018 5:01 pm
by Mountune
Still trying to work this out..

Re: Fatal Error occuring when trying to save options using SELECT (existing options deleted)

Posted: Wed Feb 21, 2018 5:07 pm
by thekrotek
Mountune wrote:
Wed Feb 21, 2018 5:01 pm
Still have this issue and due to the developer of the extension ignoring my emails as I didn't want to hand over ftp access for security reasons I'm hoping someone here can help.
Without giving up your FTP this can't be done. Moreover, an access to your DB might be required as well.

Re: Fatal Error occuring when trying to save options using SELECT (existing options deleted)

Posted: Wed Feb 21, 2018 5:34 pm
by paulfeakins
Mountune wrote:
Wed Feb 21, 2018 5:01 pm
Still have this issue and due to the developer of the extension ignoring my emails as I didn't want to hand over ftp access for security reasons I'm hoping someone here can help.
As I said, you need a dev server if you don't want to give live access.

Re: Fatal Error occuring when trying to save options using SELECT (existing options deleted)

Posted: Wed Feb 21, 2018 6:55 pm
by Mountune
Well I managed to resolve it with help of the developer. So for future reference to anyone else who encounters this / uses the search bar.

turns out that o_min and o_max didn't appear in a secondary place in the database.


- oc_options_description - This did appear and was the first thing I checked
- oc_options_value_description - They did not appear here, so after adding them the extension started to work as it should.

You have to access the database and manually add them

o_min - INT 3 - As Defined 0 - NULL
o_max - INT3 - As Defined 0 - NULL

I hope this helps others if they encounter this who also don't like giving out FTP access for security reasons. Its also a good way of learning how Opencart works and extensions integrate.