AH01071: Got error 'PHP message: PHP Warning: Trying to access array offset on null in /var/www/administrator/components/com_phocacart/libraries/phocacart/order/order.php on line 2968;
PHP message: PHP Warning: Trying to access array offset on null in /var/www/administrator/components/com_phocacart/libraries/phocacart/order/order.php on line 2969;
PHP message: PHP Warning: Trying to access array offset on null in /var/www/administrator/components/com_phocacart/libraries/phocacart/order/order.php on line 2970;
PHP message: PHP Warning: Trying to access array offset on null in /var/www/administrator/components/com_phocacart/libraries/phocacart/order/order.php on line 2971;
PHP message: PHP Warning: Trying to access array offset on null in /var/www/administrator/components/com_phocacart/libraries/phocacart/order/order.php on line 2972;
PHP message: PHP Warning: Attempt to read property "date" on null in /var/www/administrator/components/com_phocacart/libraries/phocacart/order/status.php on line 131;
PHP message: PHP Warning: Attempt to read property "order_number" on null in /var/www/administrator/components/com_phocacart/libraries/phocacart/order/status.php on line 131;
PHP errors and warnings. PC 5 beta51. PHP 8.3
- sulpher
- Phoca Professional
- Posts: 107
- Joined: 28 Feb 2017, 09:45
PHP errors and warnings. PC 5 beta51. PHP 8.3
- Jan
- Phoca Hero
- Posts: 48402
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: PHP errors and warnings. PC 5 beta51. PHP 8.3
Hi, are you 100% your database table structure is complete?
Do you have following columns in table "phocacart_orders"?
tracking_date_shipped
invoice_date
invoice_due_date
invoice_time_of_supply
required_delivery_time
Jan
Do you have following columns in table "phocacart_orders"?
tracking_date_shipped
invoice_date
invoice_due_date
invoice_time_of_supply
required_delivery_time
Jan
If you find Phoca extensions useful, please support the project
- sulpher
- Phoca Professional
- Posts: 107
- Joined: 28 Feb 2017, 09:45
Re: PHP errors and warnings. PC 5 beta51. PHP 8.3
Yes, all these columns exist in table.
It was clean installation of PC5 beta51 on J5.1.0.
It was clean installation of PC5 beta51 on J5.1.0.
- Jan
- Phoca Hero
- Posts: 48402
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: PHP errors and warnings. PC 5 beta51. PHP 8.3
This is hard to say because when the columns are loaded from DB, they should be included in the array/object. Where exactly do you get these errors?
Jan
Jan
If you find Phoca extensions useful, please support the project
- sulpher
- Phoca Professional
- Posts: 107
- Joined: 28 Feb 2017, 09:45
Re: PHP errors and warnings. PC 5 beta51. PHP 8.3
I can't remember what I did that lead to these issues. I tested payment plugins. WIll take more attention during the next testing.
Btw, is there a situation that some outdated code in the payment plugin leads to these warnings?
Btw, is there a situation that some outdated code in the payment plugin leads to these warnings?
- Jan
- Phoca Hero
- Posts: 48402
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: PHP errors and warnings. PC 5 beta51. PHP 8.3
These are errors inside core libraries, so yes, it is possible that some obsolete plugin can invoke it but the core should somehow protect from this. But on the mentioned lines, the code goes directly from database, so the variables should be loaded there.
Jan
Jan
If you find Phoca extensions useful, please support the project
- sulpher
- Phoca Professional
- Posts: 107
- Joined: 28 Feb 2017, 09:45
Re: PHP errors and warnings. PC 5 beta51. PHP 8.3
Today I logged in to the site, proceeded to My orders page and go to empty checkout page. No payment method was launched and there are entries in error.log:
PC 5.0.0Beta54, PHP 8.3.8, Joomla 5.1.1
PHP Warning: Trying to access array offset on null in /var/www//administrator/components/com_phocacart/libraries/phocacart/order/order.php on line 2971; PHP message: PHP Warning:
Trying to access array offset on null in /var/www//administrator/components/com_phocacart/libraries/phocacart/order/order.php on line 2972; PHP message:
PHP Warning: Trying to access array offset on null in /var/www//administrator/components/com_phocacart/libraries/phocacart/order/order.php on line 2973; PHP message: PHP Warning: Trying to access array offset on null in /var/www//administrator/components/com_phocacart/libraries/phocacart/order/order.php on line 2974;
PHP message: PHP Warning: Trying to access array offset on null in /var/www//administrator/components/com_phocacart/libraries/phocacart/order/order.php on line 2975;
PHP message: PHP Warning: Attempt to read property "order_number" on null in /var/www//administrator/components/com_phocacart/libraries/phocacart/order/status.php on line 131; PHP message: PHP Warning: Attempt to read property "user_id" on null in /var/www//administrator/components/com_phocacart/libraries/phocacart/order/status.php on line 443'
PC 5.0.0Beta54, PHP 8.3.8, Joomla 5.1.1
- Jan
- Phoca Hero
- Posts: 48402
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: PHP errors and warnings. PC 5 beta51. PHP 8.3
Hi, see the code, there is a database query which asks the columns, e.g. column: tracking_date_shipped
and then you ask the value with:
$d['tracking_date_shipped'] = $orderData['tracking_date_shipped'];
Then it is not possible, that this value will be null, except, e.g. the database column does not exist in your database
Check the table #__phocacart_orders for tracking_date_shipped column
Can you let me know the code of: administrator/components/com_phocacart/libraries/phocacart/order/order.php
between lines: 2964 and 2976?
Jan
Code: Select all
$query = ' SELECT date, invoice_number_id, invoice_number, invoice_prn, invoice_date, invoice_due_date, invoice_time_of_supply, tracking_date_shipped, required_delivery_time FROM #__phocacart_orders WHERE id = ' . (int)$id . ' ORDER BY id LIMIT 1';
$d['tracking_date_shipped'] = $orderData['tracking_date_shipped'];
Then it is not possible, that this value will be null, except, e.g. the database column does not exist in your database
Check the table #__phocacart_orders for tracking_date_shipped column
Can you let me know the code of: administrator/components/com_phocacart/libraries/phocacart/order/order.php
between lines: 2964 and 2976?
Jan
If you find Phoca extensions useful, please support the project
- sulpher
- Phoca Professional
- Posts: 107
- Joined: 28 Feb 2017, 09:45
Re: PHP errors and warnings. PC 5 beta51. PHP 8.3
this column exists:Jan wrote: ↑11 Jun 2024, 16:12 Hi, see the code, there is a database query which asks the columns, e.g. column: tracking_date_shipped
and then you ask the value with:Code: Select all
$query = ' SELECT date, invoice_number_id, invoice_number, invoice_prn, invoice_date, invoice_due_date, invoice_time_of_supply, tracking_date_shipped, required_delivery_time FROM #__phocacart_orders WHERE id = ' . (int)$id . ' ORDER BY id LIMIT 1';
$d['tracking_date_shipped'] = $orderData['tracking_date_shipped'];
Then it is not possible, that this value will be null, except, e.g. the database column does not exist in your database
Check the table #__phocacart_orders for tracking_date_shipped column
btw, I just installed several beta versions over existing ones. Is it necessary? No SQL code need to be executed?
As we see, the required column exists, but I just ask for future.
Here is code (PC 5.0 beta54 installed) :Can you let me know the code of: administrator/components/com_phocacart/libraries/phocacart/order/order.php
between lines: 2964 and 2976?
Jan
Code: Select all
$db->setQuery($query);
$orderData = $db->loadAssoc();
// SEE: administrator/components/com_phocacart/tables/phocacartorder.php
// some date columns cannot have null values, as null values will be transformed to 0000-00-00 00:00:00 in check function
// instead of leaving yet stored data in database (values with null standardly do not change current data in database)
// $d['date'] - defined previously
$d['tracking_date_shipped'] = $orderData['tracking_date_shipped'];
$d['invoice_date'] = $orderData['invoice_date'];
$d['invoice_due_date'] = $orderData['invoice_due_date'];
$d['invoice_time_of_supply']= $orderData['invoice_time_of_supply'];
$d['required_delivery_time']= $orderData['required_delivery_time'];
- Jan
- Phoca Hero
- Posts: 48402
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: PHP errors and warnings. PC 5 beta51. PHP 8.3
The code is the same on your instance, so hard to say why it does produce such errors. I will try to do more tests.
Jan
Jan
If you find Phoca extensions useful, please support the project