Jump to content

Recommended Posts

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

Share this post


Link to post
Share on other sites

Just wrap that in...

if (is_array($customers_dob) && isset($customers_dob)) {

.....

}

Try it without the is_array() function.

 

 

Edited by Demitry

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

Share this post


Link to post
Share on other sites

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 by Hotclutch

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
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.

 

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×