mass actions - error "operator not supported for strings"

  • Posts: 141
  • Thank you received: 3
4 years 7 months ago #311222

-- HikaShop version -- : 4.2.1
-- Joomla version -- : 3.9.8
-- PHP version -- : 7.2.14

Hello, I have problem with mass actions – after I try to launch mass action I got following error message:

“An error has occurred. [] operator not supported for strings
/camertest/administrator/components/com_hikashop/classes/massaction.php:2017”
Notice: Array to string conversion in /camertest/libraries/vendor/joomla/filter/src/InputFilter.php on line 362


as presented here:



or following (depends on mass action parameters):
Notice: Array to string conversion in /camertest/libraries/vendor/joomla/filter/src/InputFilter.php on line 362
Warning: Cannot modify header information - headers already sent by (output started at /camertest/libraries/vendor/joomla/filter/src/InputFilter.php:362) in /camertest/administrator/components/com_hikashop/helpers/spreadsheet.php on line 68


as presented here:



even if I only try to save a new mass action following message is appearing:

Notice: Array to string conversion in /camertest/libraries/vendor/joomla/filter/src/InputFilter.php on line 362

I would like to ask for hint how can I solve this problem.

Regards,
Greg

Attachments:
Last edit: 4 years 7 months ago by Greg_C.

Please Log in or Create an account to join the conversation.

  • Posts: 81515
  • Thank you received: 13069
  • MODERATOR
4 years 7 months ago #311235

Hi,

The "array to string" conversion notice message is something linked to another extension normally:
www.hikashop.com/forum/install-update/89...uct-mass-action.html
And it should already have been fixed by them. So maybe you need to update the plugins ?
Regarding the "operator not supported for strings" error, could you provide a screenshot of the settings of your mass action so that we can better understand the situation ?

Please Log in or Create an account to join the conversation.

  • Posts: 141
  • Thank you received: 3
4 years 7 months ago #311256

Hi Nicolas, I have tried to reproduce the problem on new clean site installing components/modules one after another and checking if one of them is causing this problem but even when I have installed all components/modules which I am using, this problem wasn’t reproduce and mass action was working properly on this new site. Then I have tried to reproduce custom fields, which I have on my site to check if these custom fields are causing the problem and I have found the reason:

after I created following custom field:
- column name “category”
- label “Category”
- table “product”
- field type multidropdown
- values: A, B, C
- and I assigned this field to Hikashop product categories in the block “Restrictions” – for example Hikashop product categories “Products”

and I launched mass action with following parameters:
Setting Data as Product
No Triggers
Setting Filters as Category Name with the value equal to Hikashop product categories “Products” (which was previously assigned to the custom field “category” in the block “Restrictions”)
Setting Actions as Export a csv file with following fields: product_alias, product_code, product_name, category_name

and then problem has occured

Summarizing - the problem occurs when:
a) was created custom field with column name “category” (other custom fields which I am using didn't cause the problem) and
b) mass action has no Filters or has Filters which includes Hikashop product categories, which were assigned to the custom field with column name “category” (in the block “Restrictions” of the custom field – for example “Products”) and
c) mass action contain in Actions section (in mass action window below the dropdown list with position “Export a csv file”) any of the field from category group, for example category_name

Additionally even if I deleted custom field with column name “category” but I left in mass action set any of the field from category group (for example category_name) the problem still occurs – I think this is because information about the custom field with column name “category” still exist in product data – after deletion custom field is not visible in Product data in Hikashop backend but is still kept in SQL database in the table hikashop_product. So to solve the problem not only custom field with column name “category” has to deleted but also all products, which were previously assigned to Hikashop product categories, which were assigned to this custom field ( in the block “Restrictions” in custom fields parameters).

Please let me know if my description of the problem is understandable and if you were able to reproduce this problem and how this problem can be solved.

Regards,
Greg

Last edit: 4 years 7 months ago by Greg_C.

Please Log in or Create an account to join the conversation.

  • Posts: 81515
  • Thank you received: 13069
  • MODERATOR
4 years 6 months ago #311296

Hi,

I tried to follow your instructions but I didn't get an error.
But looking at the code near the error and based on your description, I understand the situation.
The attribute "category" is already used to store the data of the categories when the mass action is loading the data, so you should use another column name for your custom field.
We'll add that word to the list of reserved column names so that it doesn't happen in the future.

Please Log in or Create an account to join the conversation.

  • Posts: 141
  • Thank you received: 3
4 years 6 months ago #311307

Hi Nicolas, ok, thank you for the information

Regards,
Greg

Please Log in or Create an account to join the conversation.

Time to create page: 0.074 seconds
Powered by Kunena Forum