Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,486
    Plugin Contributions
    88

    Default sqlpatch.php help-text gives "bad" information

    Looking through the help-text (by pressing the Details button) for the admin Tools->Install SQL Patches, the first example under "Advanced Methods" specifies the following code block as a guideline:
    Code:
    #NEXT_X_ROWS_AS_ONE_COMMAND:4
    SET @t1=0;
    SELECT (@t1:=configuration_value) as t1
    FROM configuration
    WHERE configuration_key = 'KEY_NAME_HERE';
    UPDATE product_type_layout SET configuration_value = @t1 WHERE configuration_key = 'KEY_NAME_TO_CHECK_HERE';
    DELETE FROM configuration WHERE configuration_key = 'KEY_NAME_HERE';
    The SQL fragment highlighted above in red was previously identified by swguy as problematic (http://www.zen-cart.com/showthread.p...es-please-note!) and the source of the "Attribute Required for Text flag not working" issue. As such, the help text should be modified to give the correct usage.

    P.S. It would "help" to have the "Details" button renamed to "Help" ...

  2. #2
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: sqlpatch.php help-text gives "bad" information

    The point of the example wasn't the actual SQL at all. It was the use of the "#NEXT_X_ROWS_AS_ONE_COMMAND:4" which tells the script to treat the next 4 lines as one submitted statement, instead of splitting them all up after each ending semicolon.

    The actual SQL in the example has no direct affect on attributes in any way.

    We'll consider a different example in a future release.
    .

    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.

  3. #3
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: sqlpatch.php help-text gives "bad" information

    Further investigation reveals that perhaps the post you quoted from swguy is incorrect.

    Running the following code (even without the #NEXT_X_ROWS... instruction) works just fine, thus suggesting that there's nothing wrong with the SQL:
    Code:
    SET SET @t4=0;
    SELECT (@t4:=configuration_group_id) as t4 FROM configuration_group WHERE configuration_group_title= 'Images';
    UPDATE configuration set configuration_value=@t4 where configuration_key = 'STORE_NAME';
    UPDATE configuration set configuration_value=@t4 where configuration_key = 'STORE_OWNER';
    (this will set Admin->Configuration->My Store-> store name and store owner to '4'. Naturally you'll want to fix those to their correct values if you run this test.)

    So, I must ask: have you actually tested the examples and found a specific problem? Or are you merely pointing out a discrepancy between swguy's suggestion vs the help text provided within Zen Cart?
    .

    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. #4
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,690
    Plugin Contributions
    123

    Default Re: sqlpatch.php help-text gives "bad" information

    @lat9: The issue, which is described more fully in http://www.zen-cart.com/showthread.p...178#post993178 is not that the use of this statement is problematic:

    Code:
    SET @t1=0;
    It's the use of delete without checking the configuration group id. If you use

    Code:
    DELETE FROM configuration WHERE configuration_group_id = @t4 AND configuration_group_id !=0;
    DELETE FROM configuration_group WHERE configuration_group_id = @t4 AND configuration_group_id !=0;
    Then you'll be fine.
    Last edited by swguy; 18 Jul 2012 at 12:19 PM.
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  5. #5
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,486
    Plugin Contributions
    88

    Default Re: sqlpatch.php help-text gives "bad" information

    Thanks for the clarification, swguy ... MySQL is (obviously) not one of my fortes.

    As far as this bug-report goes, I believe that the updated example should read:

    Code:
    #NEXT_X_ROWS_AS_ONE_COMMAND:4
    SET @t1=0;
    SELECT (@t1:=configuration_value) as t1
    FROM configuration
    WHERE configuration_key = 'KEY_NAME_HERE';
    UPDATE product_type_layout SET configuration_value = @t1 WHERE configuration_key = 'KEY_NAME_TO_CHECK_HERE' AND t1 !=0;
    DELETE FROM configuration WHERE configuration_key = 'KEY_NAME_HERE' AND t1 !=0;

 

 

Similar Threads

  1. "information" text --hiding out in additional images code
    By phillycheese123 in forum General Questions
    Replies: 3
    Last Post: 22 Aug 2012, 03:24 PM
  2. How to add more pages into "Information"? (sideboxes/information.php)
    By n_t_r in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 27 May 2011, 01:50 PM
  3. Combine product "image" and "text" links into one - SEO help!
    By blackhalo in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 31 Jul 2008, 10:14 PM
  4. Replies: 0
    Last Post: 17 Apr 2008, 08:02 PM
  5. Need help changing text size for: "Congratulations" & "Welcome Guest" on main page
    By STFlats in forum Templates, Stylesheets, Page Layout
    Replies: 12
    Last Post: 16 Apr 2007, 04:32 AM

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