Zen Cart Attribute Required for Text not working?

If you have added a text attribute to a product in  your Zen Cart installation (any version), and clicked the “Attribute Required for Text” = Yes radio button at the bottom of the screen, but noticed that it can be added to the cart without setting the text attribute, this post is for you.

There is a bug in a number of older Zen Cart contributions that leads to configuration group 0 getting deleted.  As it turns out, this is where some critical fields for Attribute Required for Text reside.   You can see if you have this problem by going to

http://YOUR-SITE/your-admin-page/configuration.php?gID=0

You should see three entries.  If you see zero entries, you can add them back using this SQL:

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);

Once this is done, your attribute checking should work.

A list of some of the contributions which had this issue (as well as the background on this issue) is provided in this Zen Cart forum post.