PDA


View Full Version : Unable to upload module


Tom M
12-14-2005, 03:41 AM
I created a module on my test db with custom options and had things working properly. I then downloaded the module so I could move it to my live forum and ran into this during the upload

Database error in vBulletin 3.5.2:

Invalid SQL:
INSERT INTO adv_setting (varname, grouptitle, value, defaultvalue, optioncode, displayorder) VALUES ('portal_rss_qualifier', 'adv_portal_rss', 'return !preg_match("/story/i", $rss_item['DESCRIPTION']);', '', 'textarea', '8');

MySQL Error : You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'DESCRIPTION']);', '', 'textarea', '8')' at line 1 Error Number : 1064
Date : Wednesday, December 14th 2005 @ 02:22:17 AM

It appears that while it's OK to enter quotes into the text areas and download them it fails when trying to upload them again.

Brian
12-15-2005, 02:58 PM
I'm surprised someone hasn't run into this problem before. If you'll look in your admincp/vba_cmps_admin.php file for this code:
$db->query_write("INSERT INTO " . TABLE_PREFIX . "adv_setting (varname, grouptitle, value, defaultvalue, optioncode, displayorder) VALUES ('$varname', 'adv_portal_$module[identifier]', '$setting[value]', '$setting[defaultvalue]', '" . addslashes($setting['optioncode']) . "', '$setting[displayorder]')");


And replace with this:
$db->query_write("INSERT INTO " . TABLE_PREFIX . "adv_setting (varname, grouptitle, value, defaultvalue, optioncode, displayorder) VALUES ('$varname', 'adv_portal_$module[identifier]', '" . addslashes($setting['value']) . "', '" . addslashes($setting[defaultvalue]) . "', '" . addslashes($setting['optioncode']) . "', '$setting[displayorder]')");

Then that should take care of the problem.