Hi mc12345678, thanks for your thoughts.
Originally Posted by
mc12345678
Use of existing examples that behave as desired for new fields is always a great way to expand on design.
Good advice as always, I've tried that, and tried on that basis to set up the checklist to figure out what I might have missed.
Originally Posted by
mc12345678
First I want to speak briefly about the SESSION aspect, note that a logged in user will have the customers_id stored to the session. That information alone should be enough to pull any basic information about the user. So generally speaking storing the customer's name in the session should only be necessary (if only briefly) when transitioning/redirecting from one page to the next where POST data can not also be passed along. In a way, it can become a security issue and a waste of resources. The program manages a database, why store a value that can be looked up from the database with a known piece of information? Let me also say, I understand that this is not expected to be done for all cases, just wanted to express concern about over use of session variables.
So some other things of consideration: use of $_POST data to determine/collect the information to be stored to or retrieved from the database.
If a field should have a minimum and/or maximum number of characters.
Thanks for that insight. So in general, not needed, and to be avoided if possible. I took my queue from includes/modules/pages/account_edit/header_php.php where the session variables for first and last names are updated:
PHP Code:
$db->perform(TABLE_ADDRESS_BOOK, $sql_data_array, 'update', $where_clause);
$zco_notifier->notify('NOTIFY_HEADER_ACCOUNT_EDIT_UPDATES_COMPLETE');
// reset the session variables
$_SESSION['customer_first_name'] = $firstname;
$_SESSION['customer_last_name'] = $lastname;
Originally Posted by
mc12345678
For the fields that have been added but appear hard to get back, may I suggest searching the code (either catalog side or admin respectfully) for the database table that contains that additional data? Remember to use the format such as: TABLE_PRODUCTS
There may be "helper" functions that are pulling information that is currently being seen as well as specific queries on the page that is being used.
Good point, I have been scanning code following the program logic as best I can, but yes, I should check if I have missed some logic branches and the associated database select and/or update statements. Should not forget this in future.
Originally Posted by
mc12345678
As to the string/stringIgnoreNull issue: at one point in development history, the ZC team came to realize as did much of the programming world, that if a person or business had a name (middle, last or otherwise) that was just "Null", like Mr. or Mrs. Null, then databases would have an issue because entry of that name field would cause the database to treat that entry as if the field had no information. So... the work around was to create a new handler (stringIgnoreNull) that would allow the word null to exist as a word and not revert to an empty field. In so doing, the string handler was modified such that if the word null or maybe it was NULL was anywhere in the submitted text that the entire field would become an empty field known as null. As said, there was a point in time where this feature was added. Depending on how far back you are considering supporting, you may need to adjust for the ability to use stringIgnoreNull.
Much appreciated. So it has no direct bearing on the required or optional status of a field, but directly to do with the value input when there is an input value.
I still haven't found my solution yet to retrieving updated furigana name and telephone numbers, but I will be checking possibly missed database queries from now. I'll update when I do solve the issue to make it easier for others to follow a similar procedure in future.
Bookmarks