Page 1 of 2 12 LastLast
Results 1 to 10 of 20
  1. #1
    Join Date
    Mar 2009
    Location
    Seattle, WA
    Posts
    221
    Plugin Contributions
    1

    Default Attribute Required for Text flag not working

    ZC v1.3.9h
    Database Patch Level: 1.3.9h
    PHP v5.2.14
    Contributions: CKEditor v3.4, Easy Populate v1.2.5.5, IH2 v2.0 Rev 8c, Order Steps Tableless v2.3.2, Quick Updates v2.04, SitemapXML v2.1.0
    Originally built with 1.3.8a and upgraded to 1.3.9h a couple of months ago.


    I recently needed to lock down some attribute text boxes to require input prior to adding to shopping cart. I have never done this before, so no idea if it ever would have worked.

    I modified each TEXT option name to enable the "Attribute Required for Text" attribute flag.

    In testing, the product is added to the shopping cart without forcing me to fill in the required text fields. Essentially, the required attribute flag does nothing.

    I found some forum threads from 2007 regarding this issue, but I am somewhat confused as I can't duplicate problem in brand new install. Someone pointed to the "Google Sitemaps" SQL install patch as the culprit as it overwrote items in the configuration table. I have never installed the old Google Sitemaps contribution. I did however install SitemapXML (back when I was on v1.3.8a) which was the new replacement for Google Sitemaps.


    As a test, I installed a fresh 1.3.9h in a test directory, brand new database, no contributions. The Attribute Required flag works perfectly.
    I then installed SitemapXML. The Attribute Required flag still works perfectly.


    I then searched through a SQL dump of production database looking for the referenced Configuration values in this post. I could not find the following values in my production database (no clue why they are missing as I never installed Google Sitemaps):
    Code:
    INSERT INTO `configuration` VALUES ('', 'Product option type Select', 'PRODUCTS_OPTIONS_TYPE_SELECT', '0', 'The number representing the Select type of product option.', 0, NULL, '2007-03-19 17:57:39', '2007-03-19 17:57:39', NULL, NULL);
    INSERT INTO `configuration` VALUES ('', 'Upload prefix', 'UPLOAD_PREFIX', 'upload_', 'Prefix used to differentiate between upload options and other options', 0, NULL, '2007-03-19 17:57:39', '2007-03-19 17:57:39', NULL, NULL);
    INSERT INTO `configuration` VALUES ('', 'Text prefix', 'TEXT_PREFIX', 'txt_', 'Prefix used to differentiate between text option values and other option values', 0, NULL, '2007-03-19 17:57:39', '2007-03-19 17:57:39', NULL, NULL);
    As a test, I inserted the following via Install SQL Patches into a test copy of my production database (from the 2007 forum post):
    Code:
    INSERT INTO `configuration` VALUES ('', 'Product option type Select', 'PRODUCTS_OPTIONS_TYPE_SELECT', '0', 'The number representing the Select type of product option.', 0, NULL, '2010-12-17 23:00:00', '2010-12-17 23:00:00', NULL, NULL);
    INSERT INTO `configuration` VALUES ('', 'Upload prefix', 'UPLOAD_PREFIX', 'upload_', 'Prefix used to differentiate between upload options and other options', 0, NULL, '2010-12-17 23:00:00', '2010-12-17 23:00:00', NULL, NULL);
    INSERT INTO `configuration` VALUES ('', 'Text prefix', 'TEXT_PREFIX', 'txt_', 'Prefix used to differentiate between text option values and other option values', 0, NULL, '2010-12-17 23:00:00', '2010-12-17 23:00:00', NULL, NULL);
    This appears to have fixed the Attribute required flag as it is now functioning in my test copy of site.

    Question, are the statements that I inserted above correct for Zen Cart 1.3.9h?

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,394
    Plugin Contributions
    6

    Default Re: Attribute Required for Text flag not working

    You can always check the default settings in the file:
    /zc_install/sql/mysql_zencart.sql
    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!

  3. #3
    Join Date
    Mar 2009
    Location
    Seattle, WA
    Posts
    221
    Plugin Contributions
    1

    Default Re: Attribute Required for Text flag not working

    The statements are different in the mysql_zencart.sql - the following is added to each statement:

    (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function)

    and the dates are specified as now().

    Should I be inserting the sql exactly as what is in the install file?

    Code:
    INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Product option type Select', 'PRODUCTS_OPTIONS_TYPE_SELECT', '0', 'The number representing the Select type of product option.', 0, NULL, now(), now(), NULL, NULL);
    INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Upload prefix', 'UPLOAD_PREFIX', 'upload_', 'Prefix used to differentiate between upload options and other options', 0, NULL, now(), now(), NULL, NULL);
    INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Text prefix', 'TEXT_PREFIX', 'txt_', 'Prefix used to differentiate between text option values and other option values', 0, NULL, now(), now(), NULL, NULL);

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,394
    Plugin Contributions
    6

    Default Re: Attribute Required for Text flag not working

    now() just grabs the current date, specifying a date is fine ...
    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!

  5. #5
    Join Date
    Mar 2009
    Location
    Seattle, WA
    Posts
    221
    Plugin Contributions
    1

    Default Re: Attribute Required for Text flag not working

    ok, I inserted the same exact statements as contained in the mysql_zencart.sql:

    Code:
    INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Product option type Select', 'PRODUCTS_OPTIONS_TYPE_SELECT', '0', 'The number representing the Select type of product option.', 0, NULL, now(), now(), NULL, NULL);
    INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Upload prefix', 'UPLOAD_PREFIX', 'upload_', 'Prefix used to differentiate between upload options and other options', 0, NULL, now(), now(), NULL, NULL);
    INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Text prefix', 'TEXT_PREFIX', 'txt_', 'Prefix used to differentiate between text option values and other option values', 0, NULL, now(), now(), NULL, NULL);
    This has resolved the Attribute Required for Text issue.

  6. #6
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    5,570
    Plugin Contributions
    210

    Default Re: Attribute Required for Text flag not working

    FYI I just saw this on a fresh install of 1.3.9F that was done a couple of months back.
    That Software Guy, Plugin Moderator. Store: Zen Cart Modifications
    Contributions: Quantity Discounts, Better Together, SMS on Sale, Gift Wrap at Checkout, and more.

  7. #7
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    5,570
    Plugin Contributions
    210

    Default Re: Attribute Required for Text flag not working

    I wonder if the root cause of this is that for the text flag prefix (and 2 other values upload prefix and product option type select), the sort order is 0, and something is stomping on this? What if these were changed to 6 like the values around them?

    INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Product option type Select', 'PRODUCTS_OPTIONS_TYPE_SELECT', '0', 'The number representing the Select type of product option.', 6, NULL, now(), now(), NULL, NULL);

    INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Upload prefix', 'UPLOAD_PREFIX', 'upload_', 'Prefix used to differentiate between upload options and other options', 6, NULL, now(), now(), NULL, NULL);

    INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Text prefix', 'TEXT_PREFIX', 'txt_', 'Prefix used to differentiate between text option values and other option values', 6, NULL, now(), now(), NULL, NULL);

    (obviously the existing keys TEXT_PREFIX, UPLOAD_PREFIX and PRODUCTS_OPTIONS_TYPE_SELECT would need to be deleted before doing this.)
    Last edited by swguy; 29 Jan 2011 at 06:29 PM. Reason: clarification
    That Software Guy, Plugin Moderator. Store: Zen Cart Modifications
    Contributions: Quantity Discounts, Better Together, SMS on Sale, Gift Wrap at Checkout, and more.

  8. #8
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    5,570
    Plugin Contributions
    210

    Default Re: Attribute Required for Text flag not working

    That Software Guy, Plugin Moderator. Store: Zen Cart Modifications
    Contributions: Quantity Discounts, Better Together, SMS on Sale, Gift Wrap at Checkout, and more.

  9. #9
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    5,570
    Plugin Contributions
    210

    Default Re: Attribute Required for Text flag not working

    Here's the root cause. Some mods which have SQL scripts that create new configuration groups will do an initial cleanup like this: (this example is taken from Printable Price List)

    SELECT @pricelistid:=configuration_group_id
    FROM configuration_group WHERE configuration_group_title="Printable Price-list";

    DELETE FROM configuration WHERE configuration_group_id=@pricelistid;
    DELETE FROM configuration_group WHERE configuration_group_id=@pricelistid;

    This works and does not cause problems. However, other mods set an initial value for the variable. This causes the problem. The example below is taken from Fual Slimbox:

    SET @t4=0;
    SELECT (@t4:=configuration_group_id) as t4
    FROM configuration_group
    WHERE configuration_group_title= 'Fual Slimbox';
    DELETE FROM configuration WHERE configuration_group_id = @t4;
    DELETE FROM configuration_group WHERE configuration_group_id = @t4;

    If you run this sql, and you have not previously installed Fual Slimbox, you will delete the 2 prefix and product options type select values which are in group 0.

    Again, I believe the proper way to resolve this is to change the Zen Cart sql to put these items in a non-zero group.

    I did a quick check of some mods I have downloaded (not an exhaustive list), and the following mods have this bug:

    FAQ Manager
    Google Analytics
    SimpleSEOURL
    Fual Slimbox
    Super Orders
    Integrated COWOA
    Google Sitemap Admin
    Autoresponder+
    Return Authorization
    Recover Cart Sales
    CaptchaTTF and Hide Phone
    Amazon Exporter
    Fast and Easy Checkout
    Testimonial Manager
    Ty Package Tracker
    That Software Guy, Plugin Moderator. Store: Zen Cart Modifications
    Contributions: Quantity Discounts, Better Together, SMS on Sale, Gift Wrap at Checkout, and more.

  10. #10
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    5,570
    Plugin Contributions
    210

    Default Re: Attribute Required for Text flag not working

    Following up to summarize some of this:

    Q: Required text attributes aren't working. How do you know if I have the problem mentioned in this thread?
    A: Run the SQL command

    SELECT * FROM configuration WHERE configuration_group_id =0

    If you don't get 3 rows returned, you have this problem.

    Q: How do I fix it if I have this problem?
    A: Use the fix from this post:

    http://www.zen-cart.com/forum/showpo...17&postcount=3
    That Software Guy, Plugin Moderator. Store: Zen Cart Modifications
    Contributions: Quantity Discounts, Better Together, SMS on Sale, Gift Wrap at Checkout, and more.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v150 Text Required Attribute Not Working
    By NMac in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 15 Oct 2012, 07:05 PM
  2. "Attribute Required for Text" - what would make it stop working?
    By aaelghat in forum Setting Up Categories, Products, Attributes
    Replies: 52
    Last Post: 1 Nov 2011, 04:33 AM
  3. Re: Attribute Required for Text flag not working
    By dbltoe in forum Upgrading from 1.3.x to 1.5.x
    Replies: 2
    Last Post: 15 Aug 2011, 01:45 PM
  4. "Attribute Required for Text" not working...
    By aaelghat in forum General Questions
    Replies: 0
    Last Post: 21 Jun 2007, 09:59 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