- Posts: 46
- Thank you received: 6
Undefined Array Key Errors in a Mass Action
2 years 6 months ago #359992
by cmb
Charles
Undefined Array Key Errors in a Mass Action was created by cmb
-- url of the page with the problem -- : Not available online yet.
-- HikaShop version -- : 5.0.3
-- Joomla version -- : 4.4.3
-- PHP version -- : 8.2.16
-- Browser(s) name and version -- : Firefox 124.0.1
-- Error-message(debug-mod must be tuned on) -- : See the thread herein.
I was seeing some unusual results in a Mass Action that I created so in Global Configuration I set System > Debug System > Yes and Server > Error Reporting > Maximum. In some configurations of the Mass Action, the warnings shown below appear.
In nutshell, the Product Mass Action Displays the Results of:
Filters - Characteristics > Alcantara Fabric and Stitching Combinations Contains "with black stitching".
There are four characteristics in the HikaShop database:
Scenario A: Actions > Alcantara Fabric and Stitching Combinations only checked. (Three of four Characteristics not selected.)
Warning: Undefined array key "Center Stripe Color" in /administrator/components/com_hikashop/classes/massaction.php on line 747
Scenario B: Actions > Center Stripe Color only checked. (Three of four Characteristics not selected.)
Warning: Undefined array key "Alcantara Fabric and Stitching Combinations" in /administrator/components/com_hikashop/classes/massaction.php on line 747
Scenario C: Actions > None of the four Characteristics selected.
No Warnings displayed.
It appears that if I choose to display a characteristic for a product I must display all characteristics that might be included. Otherwise a warning is generated and the results might be undefined.
Unless Error Reporting is enabled, the failure is silent.
I would like to have the option to disable the display of some Characteristics. Can these errors be repaired?
-- HikaShop version -- : 5.0.3
-- Joomla version -- : 4.4.3
-- PHP version -- : 8.2.16
-- Browser(s) name and version -- : Firefox 124.0.1
-- Error-message(debug-mod must be tuned on) -- : See the thread herein.
I was seeing some unusual results in a Mass Action that I created so in Global Configuration I set System > Debug System > Yes and Server > Error Reporting > Maximum. In some configurations of the Mass Action, the warnings shown below appear.
In nutshell, the Product Mass Action Displays the Results of:
Filters - Characteristics > Alcantara Fabric and Stitching Combinations Contains "with black stitching".
There are four characteristics in the HikaShop database:
- Alcantara Fabric and Stitching Combinations (All of the products in this Mass Action have this Characteristic.)
- Center Stripe Color (Some but not all of the products in this Mass Action have this Characteristic.)
- Leather Fabric and Stitching Combinations (None of the products in this Mass Action have this Characteristic.)
- Fabric and Leather Options (None of the products in this Mass Action have this Characteristic.)
Scenario A: Actions > Alcantara Fabric and Stitching Combinations only checked. (Three of four Characteristics not selected.)
Warning: Undefined array key "Center Stripe Color" in /administrator/components/com_hikashop/classes/massaction.php on line 747
Scenario B: Actions > Center Stripe Color only checked. (Three of four Characteristics not selected.)
Warning: Undefined array key "Alcantara Fabric and Stitching Combinations" in /administrator/components/com_hikashop/classes/massaction.php on line 747
Scenario C: Actions > None of the four Characteristics selected.
No Warnings displayed.
It appears that if I choose to display a characteristic for a product I must display all characteristics that might be included. Otherwise a warning is generated and the results might be undefined.
Unless Error Reporting is enabled, the failure is silent.
I would like to have the option to disable the display of some Characteristics. Can these errors be repaired?
Charles
Please Log in or Create an account to join the conversation.
2 years 6 months ago #359997
by nicolas
Replied by nicolas on topic Undefined Array Key Errors in a Mass Action
Hi,
Thanks for your feedback.
Change the line:
to:
in the file /administrator/components/com_hikashop/classes/massaction.php and it will remove this warning.
We'll include the change on our end.
Thanks for your feedback.
Change the line:
Code:
if(!is_object($params->types[$var_name])) $params->types[$var_name] = new stdClass();
Code:
if(!isset($params->types[$var_name]) || !is_object($params->types[$var_name])) $params->types[$var_name] = new stdClass();
We'll include the change on our end.
Please Log in or Create an account to join the conversation.
Time to create page: 0.153 seconds