Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 25
  1. #11
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default 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
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  2. #12
    Join Date
    Aug 2009
    Location
    North Idaho, USA
    Posts
    2,008
    Plugin Contributions
    1

    Default 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.
    Rick
    RixStix (dot) com
    aka: ChainWeavers (dot) com

  3. #13
    Join Date
    Jan 2004
    Posts
    66,419
    Blog Entries
    7
    Plugin Contributions
    277

    Default 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:
    Code:
    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', ........
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  4. #14
    Join Date
    Aug 2009
    Location
    North Idaho, USA
    Posts
    2,008
    Plugin Contributions
    1

    Default 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 "".....
    Rick
    RixStix (dot) com
    aka: ChainWeavers (dot) com

  5. #15
    Join Date
    Aug 2009
    Location
    North Idaho, USA
    Posts
    2,008
    Plugin Contributions
    1

    Default 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.
    Rick
    RixStix (dot) com
    aka: ChainWeavers (dot) com

  6. #16
    Join Date
    Jan 2004
    Posts
    66,419
    Blog Entries
    7
    Plugin Contributions
    277

    Default 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.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  7. #17
    Join Date
    Aug 2009
    Location
    North Idaho, USA
    Posts
    2,008
    Plugin Contributions
    1

    Default 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.
    Rick
    RixStix (dot) com
    aka: ChainWeavers (dot) com

  8. #18
    Join Date
    Aug 2009
    Location
    North Idaho, USA
    Posts
    2,008
    Plugin Contributions
    1

    Default Re: Cannot insert configuration_key "" because it already exists

    Quote Originally Posted by DrByte View Post
    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.
    Rick
    RixStix (dot) com
    aka: ChainWeavers (dot) com

  9. #19
    Join Date
    Feb 2010
    Posts
    2,159
    Plugin Contributions
    17

    Default Re: Cannot insert configuration_key "" because it already exists

    Quote Originally Posted by picaflor-azul View Post
    rbarbour can you take a look at this? I have just added the patch from the DIY responsive template default.

    Thanks,

    Anne
    Quote Originally Posted by DrByte View Post
    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:
    Code:
    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', ........
    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.

  10. #20
    Join Date
    Feb 2010
    Posts
    2,159
    Plugin Contributions
    17

    Default Re: Cannot insert configuration_key "" because it already exists

    Quote Originally Posted by RixStix View Post
    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.

 

 
Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. v154 Blank screen after curesec-com file insert ("headers already sent")
    By RixStix in forum General Questions
    Replies: 4
    Last Post: 13 Sep 2015, 09:58 PM
  2. Replies: 5
    Last Post: 14 Mar 2015, 12:28 AM
  3. v139h Cannot "add to cart", "sign up", or "log in". Returns to home.
    By Damn Kitten in forum General Questions
    Replies: 3
    Last Post: 12 Aug 2013, 03:11 AM
  4. Skipped:cannot .... because it already exists
    By Wilfred in forum Installing on a Linux/Unix Server
    Replies: 26
    Last Post: 22 Nov 2010, 08:48 PM
  5. Replies: 0
    Last Post: 7 Dec 2008, 02:31 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR