Installed your latest Related_Products_Phoenix_7.5.4 on our staging site using 1.0.8.20 PHP 8
/admin/optional_related_products.php gives
Warning: Trying to access array offset on value of type null in C:\xampp8\htdocs\PhoenixCart-1.0.8.20\includes\system\versioned\1.0.7.other\1.0.7.12\product_builder.php on line 98
Any pointers appreciated.
Related Products
Warning in Admin 1.0.8.20 PHP 8 - Related Products
-
- VIP Member
- Posts: 1996
- Joined: Mon Oct 07, 2019 4:39 am
- : Buy Me A Beverage
- Contact:
Re: Warning in Admin 1.0.8.20 PHP 8
Used the Delete Orphans button and the warnings disappeared
-
- VIP Member
- Posts: 1996
- Joined: Mon Oct 07, 2019 4:39 am
- : Buy Me A Beverage
- Contact:
Re: Warning in Admin 1.0.8.20 PHP 8
I can't reproduce this error even after recent installation with empty related products table. Product class (product_builder) is not used in that page. So I have no clue how this error can be produced.
Maybe you could try error trace to get to root where the error comes from.
Maybe you could try error trace to get to root where the error comes from.
Public Phoenix Change Log Cheat Set on Google Sheets
https://docs.google.com/spreadsheets/d/ ... sp=sharing
Need Help?viewtopic.php?f=10&t=27
https://docs.google.com/spreadsheets/d/ ... sp=sharing
Need Help?viewtopic.php?f=10&t=27
-
- PhoenixCart Developer
- Posts: 1184
- Joined: Sat Dec 21, 2019 8:08 am
- : Buy Me A Beverage
- Contact:
Re: Warning in Admin 1.0.8.20 PHP 8
Ok, that's from obsolete entries in the table. I'll check it.heatherbell wrote:Used the Delete Orphans button and the warnings disappeared
Public Phoenix Change Log Cheat Set on Google Sheets
https://docs.google.com/spreadsheets/d/ ... sp=sharing
Need Help?viewtopic.php?f=10&t=27
https://docs.google.com/spreadsheets/d/ ... sp=sharing
Need Help?viewtopic.php?f=10&t=27
-
- PhoenixCart Developer
- Posts: 1184
- Joined: Sat Dec 21, 2019 8:08 am
- : Buy Me A Beverage
- Contact:
Re: Warning in Admin 1.0.8.20 PHP 8
I could reproduce it.
It happens at line 382:
I have overseen that there the product class is used to get the product name which can happen on not existing products in the products table.
I'll have a look and try to secure this.
However it might be a good idea to secure this in core:
includes\system\versioned\1.0.7.other\1.0.7.12\product_builder.php
Maybe you can forward this to @ecartz?
It happens at line 382:
Code: Select all
$products_name_slave = Product::fetch_name($relations_values['pop_products_id_slave']);
I'll have a look and try to secure this.
However it might be a good idea to secure this in core:
includes\system\versioned\1.0.7.other\1.0.7.12\product_builder.php
Code: Select all
public static function fetch_name($product_id, $language_id = null) {
if (empty($language_id)) {
$language_id = $_SESSION['languages_id'];
}
$query = $GLOBALS['db']->query(sprintf("SELECT products_name FROM products_description WHERE products_id = %d AND language_id = %d", (int)$product_id, (int)$language_id));
$result = $query->fetch_assoc();
return $result['products_name']?? '';
}
Public Phoenix Change Log Cheat Set on Google Sheets
https://docs.google.com/spreadsheets/d/ ... sp=sharing
Need Help?viewtopic.php?f=10&t=27
https://docs.google.com/spreadsheets/d/ ... sp=sharing
Need Help?viewtopic.php?f=10&t=27
-
- PhoenixCart Developer
- Posts: 1184
- Joined: Sat Dec 21, 2019 8:08 am
- : Buy Me A Beverage
- Contact:
Re: Warning in Admin 1.0.8.20 PHP 8
Updated with fix for above warning message. Thanks for the report.
Public Phoenix Change Log Cheat Set on Google Sheets
https://docs.google.com/spreadsheets/d/ ... sp=sharing
Need Help?viewtopic.php?f=10&t=27
https://docs.google.com/spreadsheets/d/ ... sp=sharing
Need Help?viewtopic.php?f=10&t=27
-
- PhoenixCart Developer
- Posts: 1184
- Joined: Sat Dec 21, 2019 8:08 am
- : Buy Me A Beverage
- Contact: