Zen Cart Logo
Forums / Upgrading to 1.5.x / Cannot insert configuration_key "" because it already exists

Cannot insert configuration_key "" because it already exists

Views: 4,229

Results 1 to 20 of 25
24 Sep 2013, 12:35 AM
#1
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

Cannot insert configuration_key "" because it already exists

I keep attempting to install a responsive template by picaflor-azul and keep getting errors when running the SQL files.

The following SQL statement yields the error which follows:

INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function, set_function) VALUES(NULL, '<font color="#0044ff">ACTIVATE Responsive Template by selecting Column Widths</font>', 'COLUMN_WIDTH', '2', 'Width of the Left and Right Columns<br />0 = Use Default Template Settings<br />1 = 75px<br />2 = 150px<br />3 = 225px',@configuration_group_id, NULL, NOW(), NULL, 'zen_cfg_select_option(array(\'0\', \'1\', \'2\', \'3\'),');

Upgrade_exceptions TABLE

Cannot insert configuration_key "" because it already exists

Given my limited knowledge of peeking/poking around, I assume the error means that configuration_key “” means “Blank, nothing, nada” is in that field. The configuration_key of nothing cannot be inserted because it already exists in the table.
Looking at the table, I find

configuration TABLE
configuration_id 1146
configuration_title Installed Modules
configuration_key blank
configuration_value blank
configuration_description This is automatically updated. No need to edit
configuration_group_id 6
sort_order 0
last_modified NULL
date_added 2012-09-21 07:10:38
use_function NULL
set_function NULL

So there is already a configuration_key “” (blank, nothing, nada)

Using ADMIN:TOOLS: Developers Tool Kit to search in zen-cart-v1.3.9h-full-fileset-10262010 for:

This is automatically updated. No need to edit

The result is admin/modules.php around line 266
'This is automatically updated. No need to edit.', '6', '0', now())");

**My logic tells me that this is what caused the BLANK configuration_key to be inserted into the database in Sept 2012.

My question is Why is it there, can I delete that entry, if so, what will be affected since it was inserted for some reason in the first place.

A default v1.3.9h install does not have this configuration_key in the database, so when upgraded to V1.5.1, the responsive template install works like a charm.

MY v1.3.9H database, converted to V1.5.1 DOES have this configuration_key and I am assuming that is why the responsive template install is failing.**

Additional info, which may or maynot be relevant:
Looking through website backups, I found a myDEBUG-adm file

[21-Sep-2012 14:10:52 UTC] PHP Warning: reset() expects parameter 1 to be array, null given in /home/MYHOSTINGACCOUNT/public_html/MySecretAdmin/modules.php on line 297
[21-Sep-2012 14:10:52 UTC] PHP Warning: Variable passed to each() is not an array or object in /home/MYHOSTINGACCOUNT/public_html/MySecretAdmin/modules.php on line 298

Also, from server logs, again, may or maynot be relevant

Line 473868: 208.94.86.183 - ProtectedFolder [21/Sep/2012:07:10:38 -0700] "GET /MySecretAdmin/modules.php HTTP/1.1" 200 3272 "-" "Mozilla/5.0 (Windows NT 5.1; rv:15.0) Gecko/20100101 Firefox/15.0.1"
Line 473869: 208.94.86.183 - ProtectedFolder [21/Sep/2012:07:10:38 -0700] "GET /MySecretAdmin/includes/languages/english/images/buttons/button_module_install.gif HTTP/1.1" 200 921 "http://chainweavers.com/MySecretAdmin/modules.php" "Mozilla/5.0 (Windows NT 5.1; rv:15.0) Gecko/20100101 Firefox/15.0.1"
Line 473870: 208.94.86.183 - ProtectedFolder [21/Sep/2012:07:10:52 -0700] "GET /MySecretAdmin/modules.php?set=&module=&action=install HTTP/1.1" 302 26 "http://chainweavers.com/MySecretAdmin/modules.php" "Mozilla/5.0 (Windows NT 5.1; rv:15.0) Gecko/20100101 Firefox/15.0.1"
Line 473871: 208.94.86.183 - ProtectedFolder [21/Sep/2012:07:10:52 -0700] "GET /MySecretAdmin/modules.php?set=&module=&action=edit HTTP/1.1" 200 3390 "http://chainweavers.com/MySecretAdmin/modules.php" "Mozilla/5.0 (Windows NT 5.1; rv:15.0) Gecko/20100101 Firefox/15.0.1"
Line 473872: 208.94.86.183 - ProtectedFolder [21/Sep/2012:07:10:53 -0700] "GET /MySecretAdmin/includes/languages/english/images/buttons/button_update.gif HTTP/1.1" 304 - "http://chainweavers.com/MySecretAdmin/modules.php?set=&module=&action=edit" "Mozilla/5.0 (Windows NT 5.1; rv:15.0) Gecko/20100101 Firefox/15.0.1"
Line 473873: 208.94.86.183 - ProtectedFolder [21/Sep/2012:07:10:53 -0700] "GET /MySecretAdmin/includes/languages/english/images/buttons/button_cancel.gif HTTP/1.1" 200 451 "http://chainweavers.com/MySecretAdmin/modules.php?set=&module=&action=edit" "Mozilla/5.0 (Windows NT 5.1; rv:15.0) Gecko/20100101 Firefox/15.0.1"
Line 473874: 208.94.86.183 - ProtectedFolder [21/Sep/2012:07:11:01 -0700] "GET /MySecretAdmin/modules.php?set= HTTP/1.1" 200 3273 "http://chainweavers.com/MySecretAdmin/modules.php?set=&module=&action=edit" "Mozilla/5.0 (Windows NT 5.1; rv:15.0) Gecko/20100101 Firefox/15.0.1"

25 Sep 2013, 12:48 PM
#2
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

Re: Cannot insert configuration_key "" because it already exists

WOW. The hackers must camp here. Within a few hours, several dozen different IP addresses started attempting /MySecretAdmin/ . Good thing that choice of characters was fake.

25 Sep 2013, 5:58 PM
#3
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Cannot insert configuration_key "" because it already exists

The hackers must camp here
Yes unfortunately - -

25 Sep 2013, 6:42 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Cannot insert configuration_key "" because it already exists

If you go to phpMyAdmin and search your database in the table:
configuration

on the field:
configuration_key

for the word:
COLUMN_WIDTH

do any rows come up?

If so, how many are there?

Now you could delete the row(s) that match that configuration_key if you want to start over on your sql stuff ...

25 Sep 2013, 7:00 PM
#5
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

Re: Cannot insert configuration_key "" because it already exists

Table: configuration
Field: configuration_key

zero entries for COLUMN_WIDTH
one entry for COLUMN_WIDTH_LEFT
one entry for COLUMN_WIDTH_RIGHT

25 Sep 2013, 7:29 PM
#6
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Cannot insert configuration_key "" because it already exists

Is there more to the sql than just that 1 line?

25 Sep 2013, 8:04 PM
#7
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

Re: Cannot insert configuration_key "" because it already exists

Well, uhm, yes. OOPS, I only included the line that looked like it had something to do with the error. Sorry.

I took the "" already exists meaning that the blank configuration_key was root of the issue.

SET @configuration_group_id=0;
SELECT (@configuration_group_id:=configuration_group_id) FROM configuration_group WHERE configuration_group_title= 'Layout Settings' LIMIT 1;
INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function, set_function) VALUES 
(NULL, '<font color="#0044ff">ACTIVATE Responsive Template by selecting Column Widths</font>', 'COLUMN_WIDTH', '2', 'Width of the Left and Right Columns<br />0 = Use Default Template Settings<br />1 = 75px<br />2 = 150px<br />3 = 225px',@configuration_group_id, NULL, NOW(), NULL, 'zen_cfg_select_option(array(\'0\', \'1\', \'2\', \'3\'),');

ALTER TABLE layout_boxes ADD show_box_min_width TINYINT( 1 ) NOT NULL DEFAULT '1' AFTER layout_box_status_single;

There's also a slew of the same error with this one too.... but I was just assuming (again), that the blank config_key was causing the problem since it was not there after a vanilla install.

SET @configuration_group_id=0;
SELECT @configuration_group_id:=configuration_group_id
FROM configuration_group
WHERE configuration_group_title= 'Responsive Sheffield Blue'
LIMIT 1;
DELETE FROM configuration WHERE configuration_group_id = @configuration_group_id AND configuration_group_id != 0;
DELETE FROM configuration_group WHERE configuration_group_id = @configuration_group_id AND configuration_group_id != 0;

INSERT INTO configuration_group (configuration_group_id, configuration_group_title, configuration_group_description, sort_order, visible) VALUES (NULL, 'Responsive Sheffield Blue Template', 'Set Slideshow Options', '1', '1');
SET @configuration_group_id=last_insert_id();
UPDATE configuration_group SET sort_order = @configuration_group_id WHERE configuration_group_id = @configuration_group_id;

INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function, set_function) VALUES 
(NULL, 'Slides JS Slideshow', 'RSB_SLIDES_STATUS', 'true', 'Activate Slides JS Slideshow', @configuration_group_id, 1, NOW(), NULL, 'zen_cfg_select_option(array(\'true\', \'false\'),'),
(NULL, 'Play Interval', 'RSB_SLIDES_PLAY', '5000', 'Play interval', @configuration_group_id, 2, NOW(), NULL, NULL),
(NULL, 'Banner Display Groups - Rsbslide1', 'SHOW_BANNERS_GROUP_SETRSB1', 'rsbslide1', 'Rsbslide 1', @configuration_group_id, 30, NOW(), NULL, NULL),
(NULL, 'Banner Display Groups - Rsbslide2', 'SHOW_BANNERS_GROUP_SETRSB2', 'rsbslide2', 'Rsbslide 2', @configuration_group_id, 31, NOW(), NULL, NULL),
(NULL, 'Banner Display Groups - Rsbslide3', 'SHOW_BANNERS_GROUP_SETRSB3', 'rsbslide3', 'Rsbslide 3', @configuration_group_id, 32, NOW(), NULL, NULL),
(NULL, 'Banner Display Groups - Rsbslide4', 'SHOW_BANNERS_GROUP_SETRSB4', 'rsbslide4', 'Rsbslide 4', @configuration_group_id, 33, NOW(), NULL, NULL),
(NULL, 'Banner Display Groups - Rsbslide5', 'SHOW_BANNERS_GROUP_SETRSB5', 'rsbslide5', 'Rsbslide 5', @configuration_group_id, 34, NOW(), NULL, NULL);

# Register the configuration page for Admin Access Control
INSERT IGNORE INTO admin_pages (page_key,language_key,main_page,page_params,menu_key,display_on_menu,sort_order) VALUES ('ressheffieldblue','BOX_CONFIGURATION_RESPONSIVE_SHEFFIELD_BLUE','FILENAME_CONFIGURATION',CONCAT('gID=',@configuration_group_id),'configuration','Y',@configuration_group_id);

INSERT INTO `banners` (`banners_id`, `banners_title`, `banners_url`, `banners_image`, `banners_group`, `banners_html_text`, `expires_impressions`, `expires_date`, `date_scheduled`, `date_added`, `date_status_change`, `status`, `banners_open_new_windows`, `banners_on_ssl`, `banners_sort_order`) VALUES
('', 'rsbslide1', 'http://www.picaflor-azul.com', 'banners/rsbslide1.jpg', 'rsbslide1', NULL, '0', NULL, NULL, '0001-01-01 00:00:00', NULL, '1', '1', '1', '0'),
('', 'rsbslide2', 'http://www.picaflor-azul.com', 'banners/rsbslide2.jpg', 'rsbslide2', NULL, '0', NULL, NULL, '0001-01-01 00:00:00', NULL, '1', '1', '1', '0'),
('', 'rsbslide3', 'http://www.picaflor-azul.com', 'banners/rsbslide3.jpg', 'rsbslide3', NULL, '0', NULL, NULL, '0001-01-01 00:00:00', NULL, '1', '1', '1', '0'),
('', 'rsbslide4', 'http://www.picaflor-azul.com', 'banners/rsbslide4.jpg', 'rsbslide4', NULL, '0', NULL, NULL, '0001-01-01 00:00:00', NULL, '1', '1', '1', '0'),
('', 'rsbslide5', 'http://www.picaflor-azul.com', 'banners/rsbslide5.jpg', 'rsbslide5', NULL, '0', NULL, NULL, '0001-01-01 00:00:00', NULL, '1', '1', '1', '0');



UPDATE configuration SET configuration_value = 100 WHERE configuration_key = 'IMAGE_SHOPPING_CART_WIDTH';
UPDATE configuration SET configuration_value = 200 WHERE configuration_key = 'IMAGE_SHOPPING_CART_HEIGHT';
UPDATE configuration SET configuration_value = 150 WHERE configuration_key = 'IMAGE_PRODUCT_LISTING_WIDTH';
UPDATE configuration SET configuration_value = 150 WHERE configuration_key = 'IMAGE_PRODUCT_LISTING_HEIGHT';
UPDATE configuration SET configuration_value = 150 WHERE configuration_key = 'IMAGE_PRODUCT_NEW_LISTING_WIDTH';
UPDATE configuration SET configuration_value = 150 WHERE configuration_key = 'IMAGE_PRODUCT_NEW_LISTING_HEIGHT';
UPDATE configuration SET configuration_value = 150 WHERE configuration_key = 'IMAGE_PRODUCT_NEW_WIDTH';
UPDATE configuration SET configuration_value = 150 WHERE configuration_key = 'IMAGE_PRODUCT_NEW_HEIGHT';
UPDATE configuration SET configuration_value = 150 WHERE configuration_key = 'IMAGE_FEATURED_PRODUCTS_LISTING_WIDTH';
UPDATE configuration SET configuration_value = 150 WHERE configuration_key = 'IMAGE_FEATURED_PRODUCTS_LISTING_HEIGHT';
UPDATE configuration SET configuration_value = 150 WHERE configuration_key = 'IMAGE_PRODUCT_ALL_LISTING_WIDTH';
UPDATE configuration SET configuration_value = 150 WHERE configuration_key = 'IMAGE_PRODUCT_ALL_LISTING_HEIGHT';
UPDATE configuration SET configuration_value = 150 WHERE configuration_key = 'CATEGORY_ICON_IMAGE_WIDTH';
UPDATE configuration SET configuration_value = 150 WHERE configuration_key = 'CATEGORY_ICON_IMAGE_HEIGHT';
UPDATE configuration SET configuration_value = 150 WHERE configuration_key = 'SUBCATEGORY_IMAGE_TOP_WIDTH';
UPDATE configuration SET configuration_value = 150 WHERE configuration_key = 'SUBCATEGORY_IMAGE_TOP_WIDTH';
UPDATE configuration SET configuration_value = 150 WHERE configuration_key = 'SUBCATEGORY_IMAGE_HEIGHT';
UPDATE configuration SET configuration_value = 150 WHERE configuration_key = 'SUBCATEGORY_IMAGE_HEIGHT';
UPDATE configuration SET configuration_value = '0' WHERE configuration_key = 'CATEGORIES_TABS_STATUS';
UPDATE configuration SET configuration_value = 2 WHERE configuration_key = 'DEFINE_BREADCRUMB_STATUS';
UPDATE configuration SET configuration_value = 0 WHERE configuration_key = 'SHOW_CUSTOMER_GREETING';
UPDATE configuration SET configuration_value = 0 WHERE configuration_key = 'SHOW_FOOTER_IP';
UPDATE configuration SET configuration_value = false WHERE configuration_key = 'PRODUCT_LIST_ALPHA_SORTER';
UPDATE configuration SET configuration_value = false WHERE configuration_key = 'PRODUCT_LIST_CATEGORIES_IMAGE_STATUS';
UPDATE configuration SET configuration_value = false WHERE configuration_key = 'PRODUCT_LIST_CATEGORIES_IMAGE_STATUS_TOP';
UPDATE configuration SET configuration_value = 0 WHERE configuration_key = 'PRODUCT_LIST_DESCRIPTION';
UPDATE configuration SET configuration_value = 0 WHERE configuration_key = 'PRODUCT_LIST_FILTER';
UPDATE configuration SET configuration_value = 1 WHERE configuration_key = 'PRODUCT_INFO_CATEGORIES_IMAGE_STATUS';
UPDATE configuration SET configuration_value = true WHERE configuration_key = 'USE_SPLIT_LOGIN_MODE';
UPDATE configuration SET configuration_value = 0 WHERE configuration_key = 'EZPAGES_STATUS_HEADER';
UPDATE configuration SET configuration_value = 1 WHERE configuration_key = 'EZPAGES_STATUS_FOOTER';
UPDATE configuration SET configuration_value = 2 WHERE configuration_key = 'SHOW_SHOPPING_CART_UPDATE';
UPDATE configuration SET configuration_value = 1 WHERE configuration_key = 'SHOW_SHOPPING_CART_DELETE';
UPDATE configuration SET configuration_value = 1 WHERE configuration_key = 'SHOW_PRODUCT_INFO_MAIN_NEW_PRODUCTS';
UPDATE configuration SET configuration_value = 2 WHERE configuration_key = 'SHOW_PRODUCT_INFO_MAIN_SPECIALS_PRODUCTS';
UPDATE configuration SET configuration_value = 3 WHERE configuration_key = 'SHOW_PRODUCT_INFO_MAIN_FEATURED_PRODUCTS';
UPDATE configuration SET configuration_value = 0 WHERE configuration_key = 'SHOW_PRODUCT_INFO_MAIN_UPCOMING';
25 Sep 2013, 8:28 PM
#8
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Cannot insert configuration_key "" because it already exists

When you say a blank configuration_key ... do you mean when you browse your table:
configuration

that you actually see a blank row in there? :lookaroun

25 Sep 2013, 8:40 PM
#9
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

Re: Cannot insert configuration_key "" because it already exists

Not a blank row. Just blank configuration_key and blank configuration_value

[Attachment no longer available]

Here are the details of each field since the screenprint is pretty tiny

configuration TABLE
configuration_id: 1146
configuration_title: Installed Modules
configuration_key: blank
configuration_value: blank
configuration_description: This is automatically updated. No need to edit
configuration_group_id: 6
sort_order: 0
last_modified: NULL
date_added: 2012-09-21 07:10:38
use_function: NULL
set_function: NULL

25 Sep 2013, 8:47 PM
#10
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Cannot insert configuration_key "" because it already exists

Have you figured out why your install script is trying to insert a new record with a blank configuration_key? It should never be doing that.

25 Sep 2013, 8:49 PM
#11
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Cannot insert configuration_key "" because it already exists

Okay ... this should be fun ...

You know what those settings are now, so I am going to ask you to click on Delete for that record ...

That will remove the record then, go browse the table:
configuration_group

do you have a group for:
Responsive Sheffield Blue Template

If so, what is the value for the:
configuration_group_id

25 Sep 2013, 9:00 PM
#12
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

Re: Cannot insert configuration_key "" because it already exists

I'm just using the sql files provided with the responsive template(s). The template install works fine with a vanilla 1.5.1 install and a vanilla 1.3.9h database upgraded to 1.5.1 But does not work with my upgraded 1.3.9h database.

I haven't a clue why/how the blank configuration key was inserted but it appeared to be generated by admin/modules.php At least that is the only place I found the configuration_description text for the blank configuration_key.

25 Sep 2013, 9:03 PM
#13
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Cannot insert configuration_key "" because it already exists

Syntactically the patch you've been given isn't properly designed to work in the SQL patch tool.

Try removing the first field from those INSERT statements, since it should never be supplied if it's just gonna be auto-incremented (null) anyway. I've highlighted them here, from your first code snippet:```
INSERT INTO configuration ([B]configuration_id,[/B] configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function, set_function) VALUES
([B]NULL,[/B] '<font color="#0044ff">ACTIVATE Responsive Template by selecting Column Widths</font>', 'COLUMN_WIDTH', '2', ........

25 Sep 2013, 9:23 PM
#14
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

Re: Cannot insert configuration_key "" because it already exists

Removed the code in Red. Tried again. Same error.

Success 3 statements processed.
Error ERROR: Cannot insert configuration_key "" because it already exists
Warning Note: 1 statements ignored. See "upgrade_exceptions" table for additional details.

"upgrade_exceptions" table just duplicates the ERROR: Cannot insert configuration_key "".....

25 Sep 2013, 9:34 PM
#15
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

Re: Cannot insert configuration_key "" because it already exists

Am I barking up the wrong tree about the blank configuration_key that was inserted in Sept 2012 and contains a description found in the admin/modules.php file?

I've installed, deleted, reinstalled so many times that I may not remember all the details but that row seems to be the difference whether then responsive template installs correctly or not.

26 Sep 2013, 3:53 AM
#16
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Cannot insert configuration_key "" because it already exists

  1. Your immediate problem is NOT that you've already got a blank-configuration-key-entry in your database. But that also should not be. But fixing that is NOT the solution to your problem with your plugin.

  2. The SQL script you're attempting to run is being intercepted by protective logic in the SQL Patch Tool that aims to save you from yourself when running patches that would throw errors. It specifically EXPECTS that any INSERT into the configuration table will be in a prescribed form/structure, and attempts to determine the configuration_key value from the query based on the format it expects the code to be in. And, for some reason yours is guessing a blank value for the key. And then when it queries the database to see if that entry is already there, it's finding a match and displaying the error message you're quoting.

Solution: run the query via phpMyAdmin instead.
Then fix whatever has caused your other configuration table entries to be damaged.

Then consider investigating why your site croaks with that SQL patch when most others do not. It would suggest someone has altered the sql patch tool, but that's only the outer layer of that very complicated onion.

26 Sep 2013, 1:13 PM
#17
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

Re: Cannot insert configuration_key "" because it already exists

Thank you DrByte.

Obviously, I'm in over my head now. I was thinking that I had done good at finding matching incidents from the timestamps in the logs for when the blank configuration_key was generated.

At this time, installing any responsive template that requires those two patches has just fallen to the bottom of my priority list.

Finding and cleaning whatever mucked things up seems to be a more important issue.

26 Sep 2013, 2:24 PM
#18
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

Re: Cannot insert configuration_key "" because it already exists

DrByte:

Then consider investigating why your site croaks with that SQL patch when most others do not. It would suggest someone has altered the sql patch tool, but that's only the outer layer of that very complicated onion.

I'm running the sql patch tool from within admin in a vanilla 1.5.1 install but with an updated 1.3.9h database.

I would think that should eliminate the possibility of an altered sql patch tool? BUT still indicates there is something not proper within my v1.3.9h database.

26 Sep 2013, 3:31 PM
#19
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: Cannot insert configuration_key "" because it already exists

picaflor-azul:

rbarbour can you take a look at this? I have just added the patch from the DIY responsive template default.

Thanks,

Anne

DrByte:

Syntactically the patch you've been given isn't properly designed to work in the SQL patch tool.

Try removing the first field from those INSERT statements, since it should never be supplied if it's just gonna be auto-incremented (null) anyway. I've highlighted them here, from your first code snippet:```
INSERT INTO configuration ([B]configuration_id,[/B] configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function, set_function) VALUES
([B]NULL,[/B] '<font color="#0044ff">ACTIVATE Responsive Template by selecting Column Widths</font>', 'COLUMN_WIDTH', '2', ........


I get the same result with configuration_id VALUE NULL as I do if I remove it from the SQL patch

Result = highest configuration_id +1

I will update my template packages at my earliest convenience, IMO  this has nothing to do with the blank configuration key issue of  @RixStix

However, DrByte is the man and if he says "remove it", remove it.

Maybe DrByte can weigh in on how to go about doing this.

I would suggest including a patch to delete current configuration_key

DELETE FROM configuration WHERE configuration_key = 'COLUMN_WIDTH';

But this will have no effect if the configuration_key is blank

Changing the sql_patch is easy enough

INSERT  INTO configuration (configuration_title, configuration_key,  configuration_value, configuration_description, configuration_group_id,  sort_order, date_added, use_function, set_function) VALUES 
('<font  color="#0044ff">ACTIVATE Responsive Template by selecting Column  Widths</font>', 'COLUMN_WIDTH', '2', 'Width of the Left and Right  Columns<br />0 = Use Default Template Settings<br />1 =  75px<br />2 = 150px<br />3 = 225px',@configuration_group_id,  NULL, NOW(), NULL, 'zen_cfg_select_option(array(\'0\', \'1\', \'2\',  \'3\'),');

Even though the SQL patch tool recognizes configuration_id as an AUTO_INCREMENT value and ignores it using the original patch.

I will copy this in the other thread as well in hopes to get a response from the man himself.
26 Sep 2013, 4:22 PM
#20
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: Cannot insert configuration_key "" because it already exists

RixStix:

Removed the code in Red. Tried again. Same error.

Success 3 statements processed.
Error ERROR: Cannot insert configuration_key "" because it already exists
Warning Note: 1 statements ignored. See "upgrade_exceptions" table for additional details.

"upgrade_exceptions" table just duplicates the ERROR: Cannot insert configuration_key "".....

If you have another similar template installed such as the Responsive Apparel Boutique Template?

Then you will get an error stating:
Error ERROR: Cannot insert configuration_key "" because it already exists

Because you already installed the sql patch when installing the other Responsive Template.