Hotclutch Posted October 15, 2021 Author Share Posted October 15, 2021 In Admin/customers.php If your DOB is set to not required in the Admin settings, then this line of code throws an error when trying to update the customer in Admin. $customers_dob = tep_db_prepare_input($_POST['customers_dob']); Warning: Undefined array key "customers_dob" approx line 32 Quote Link to comment Share on other sites More sharing options...
Hotclutch Posted October 15, 2021 Author Share Posted October 15, 2021 Required or not, still throws the error. Quote Link to comment Share on other sites More sharing options...
Demitry Posted October 15, 2021 Share Posted October 15, 2021 (edited) Just wrap that in... if (is_array($customers_dob) && isset($customers_dob)) { ..... } Try it without the is_array() function. Edited October 15, 2021 by Demitry Hotclutch 1 Quote osCommerce: made for programmers, ...because store owners do not want to be programmers. https://trends.google.com/trends/explore?date=all&geo=US&q=oscommerce Link to comment Share on other sites More sharing options...
Hotclutch Posted October 15, 2021 Author Share Posted October 15, 2021 (edited) Sorry, false alarm. The DOB problem is specific to one of my sites. Tested on a stock installation and cannot replicate the problem there. Edited October 15, 2021 by Hotclutch Demitry 1 Quote Link to comment Share on other sites More sharing options...
Hotclutch Posted October 15, 2021 Author Share Posted October 15, 2021 This does appear to be a valid problem when you turn the ACCOUNT_DOB setting to false. I change to: if (ACCOUNT_DOB == 'true') $customers_dob = tep_db_prepare_input($_POST['customers_dob']); then everything works fine. Quote Link to comment Share on other sites More sharing options...
Thomas789 Posted February 21, 2022 Share Posted February 21, 2022 Hi, I just started last week to upgrade our osCommerce web shop ( an MS 2.2 version that has been continuously modded, patched and upgraded over the years) from PHP 7.4 to PHP 8.1. For the time being this is only in a test environment (XAMPP). Whilst the corrections to the code I made so far were more or less straightforward (like described already in this thread), I hit now upon a major problem: Apparently PHP8 does not accept undefined constants anymore. Any occurrence of these result in fatal errors. This leads for instance to the modules not displaying anymore in admin if there are some uninstalled modules amongst those, as the configuration keys for those would not be in the configuration table in the database. When I add some code to the corresponding module script that checks whether the constants are defined before referencing them, I can get the modules displayed in admin, but still I am unable to install the uninstalled modules. I checked the module scripts for the latest version 2.3.4.1, but they are virtually identical to the ones in the older version, that is still relying on the use of potentially undefined constants. I wonder whether anybody has managed to get the modules functions to work with PHP8, and if yes how. Thomas Quote Link to comment Share on other sites More sharing options...
Hotclutch Posted February 21, 2022 Author Share Posted February 21, 2022 1 hour ago, Thomas789 said: Hi, I just started last week to upgrade our osCommerce web shop ( an MS 2.2 version that has been continuously modded, patched and upgraded over the years) from PHP 7.4 to PHP 8.1. For the time being this is only in a test environment (XAMPP). Whilst the corrections to the code I made so far were more or less straightforward (like described already in this thread), I hit now upon a major problem: Apparently PHP8 does not accept undefined constants anymore. Any occurrence of these result in fatal errors. This leads for instance to the modules not displaying anymore in admin if there are some uninstalled modules amongst those, as the configuration keys for those would not be in the configuration table in the database. When I add some code to the corresponding module script that checks whether the constants are defined before referencing them, I can get the modules displayed in admin, but still I am unable to install the uninstalled modules. I checked the module scripts for the latest version 2.3.4.1, but they are virtually identical to the ones in the older version, that is still relying on the use of potentially undefined constants. I wonder whether anybody has managed to get the modules functions to work with PHP8, and if yes how. Thomas You can use these 2 projects as references. Quote Link to comment Share on other sites More sharing options...
Thomas789 Posted February 22, 2022 Share Posted February 22, 2022 20 hours ago, Hotclutch said: You can use these 2 projects as references. Thanks, I got it sorted now. I made the mistake not to give an alternative value in case the module constant is not defined, so some of the properties were not defined in modules.php. By the way the dropbox download of the W3 version only contained empty folders, so I had to check out the Vanilla version. Thomas Quote Link to comment Share on other sites More sharing options...
Hotclutch Posted February 22, 2022 Author Share Posted February 22, 2022 13 minutes ago, Thomas789 said: By the way the dropbox download of the W3 version only contained empty folders, so I had to check out the Vanilla version. I checked the link now and did a download as a not logged in user, and works fine for me. Quote Link to comment Share on other sites More sharing options...
Thomas789 Posted February 22, 2022 Share Posted February 22, 2022 51 minutes ago, Hotclutch said: I checked the link now and did a download as a not logged in user, and works fine for me. It works now for me as well. I think I used a link for an add-on by mistake yesterday. Quote Link to comment Share on other sites More sharing options...
RAC Posted April 25, 2022 Share Posted April 25, 2022 Hello @Hotclutch, I am running a frozen 2.3.4 shop on php7, and would like to upgrade to a higher php version. Is it possible to update this version, if so are there a list of instructions to follow? Or do I just need to follow what you have done? TIA Shaun Quote Link to comment Share on other sites More sharing options...
Hotclutch Posted April 25, 2022 Author Share Posted April 25, 2022 13 minutes ago, RAC said: Is it possible to update this version Yes 13 minutes ago, RAC said: if so are there a list of instructions to follow? No, there is no complete list anywhere, I am pretty sure. 14 minutes ago, RAC said: Or do I just need to follow what you have done? If you want to stay on Frozen and just do php updates, then the best way to go about that would be to look at the W3 osCommerce work that I have done and/or Vanilla osCommerce, and make the required changes to your shop. Bear in mind that this task will be a lot of work and that this thread is not a complete list of updates required. Quote Link to comment Share on other sites More sharing options...
RAC Posted April 29, 2022 Share Posted April 29, 2022 Hello again, sorry I got my version wrong, I am actually running an early version of Edge! Does this make things any easier for me? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.