Magento2: Warning during search in catalog by multiple custom option values. Warning should not be generated in log.

Created on 3 Jul 2019  路  18Comments  路  Source: magento/magento2


Warning: strip_tags() expects parameter 1 to be string, array given in /.../magento2/vendor/magento/framework/Filter/StripTags.php on line 48 happens when customer using catalog search with custom option values which is not exist (for example: they existed previously, but later was deleted).

Preconditions (*)

  1. Magento 2.2.8 with sample data

Steps to reproduce (*)

  1. Go to frontend -> Men -> Tops -> Hoodies & Sweatshirts
  2. Choose black color
  3. Change URL parameter material, add ",11111" to it value

Expected result (*)

  1. Will be found products that related to "black" color filter

Actual result (*)

  1. Founded products that related to "black" color filter
  2. Received warning in log file: Warning: strip_tags() expects parameter 1 to be string, array given in /.../magento2/vendor/magento/framework/Filter/StripTags.php on line 48
FrameworFilter Fixed in 2.3.x Clear Description Confirmed Format is valid Ready for Work Reproduced on 2.2.x Reproduced on 2.3.x

All 18 comments

Hi @alexeya-ven. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • [x] Summary of the issue
  • [x] Information on your environment
  • [x] Steps to reproduce
  • [x] Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.3-develop instance - upcoming 2.3.x release

For more details, please, review the Magento Contributor Assistant documentation.

@alexeya-ven do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • [x] yes
  • [ ] no

Hi @engcom-Bravo. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

  • [ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.
  • [ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • [ ] 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • [ ] 4. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and _stop verification process here_!

  • [ ] 5. Verify that the issue is reproducible on 2.2-develop branch.

    Details- Add the comment @magento give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

  • [ ] 6. Add label Issue: Confirmed once verification is complete.

  • [ ] 7. Make sure that automatic system confirms that report has been added to the backlog.

Hello, @alexeya-ven. Thanks for applying. You see, though the attribute is of type multiselect (in Your case materials) in the Backend, it's implementation in the Frontent (Layered Navigation) remains as of single choice type. Please take a note of the following product: Hero Hoodie - one of the products that appears on the page while following Your Steps to Reproduce. This product contains Fleece (value=145) as well as Hemp (value=146) materials. But in Layered Navigation section You can't chose, if You want to, Both of these materials, You can chose ether Fleece or Hemp. In both cases of course Hero Hoodie will appear among the outputted products. And once You have chosen one of the materials the materials filter is no longer available to add another value to it. So again, You are not able to get only those products that contain both materials at the same time, like Hero Hoodie. In the same way filtering via URL won't work ether. It will result in that warning, because the filtering function on some level expects only one value and not an array of values. So if you pass to Your URL "?materials=145,146" it will take to process only 145 and so will output all the products containing Fleece. As for the presence of other part after comma it will cast that warning.

Hi @engcom-Bravo the main reason that the warning should not be generated in log.

@magento give me 2.3-develop instance

@magento give me 2.3-develop instance

Hi @Nazar65. Thank you for your request. I'm working on Magento 2.3-develop instance for you

Hi @Nazar65, here is your Magento instance.
Admin access: https://i-23557-2-3-develop.instances.magento-community.engineering/admin
Login: admin Password: 123123q
Instance will be terminated in up to 3 hours.

@magento give me 2.3-develop instance

Hi @engcom-Bravo. Thank you for your request. I'm working on Magento 2.3-develop instance for you

Hi @engcom-Bravo, here is your Magento instance.
Admin access: https://i-23557-2-3-develop.instances.magento-community.engineering/admin
Login: admin Password: 123123q
Instance will be terminated in up to 3 hours.

@magento give me 2.2-develop instance

Hi @engcom-Bravo. Thank you for your request. I'm working on Magento 2.2-develop instance for you

Hi @engcom-Bravo, here is your Magento instance.
Admin access: https://i-23557-2-2-develop.instances.magento-community.engineering/admin
Login: admin Password: 123123q
Instance will be terminated in up to 3 hours.

Warning should not be generated in log.

:white_check_mark: Confirmed by @engcom-Bravo
Thank you for verifying the issue. Based on the provided information internal tickets MC-17974, MC-17975 were created

Issue Available: @engcom-Bravo, _You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself._

Hi @alexeya-ven. Thank you for your report.
The issue has been fixed in magento/magento2#23687 by @edenduong in 2.3-develop branch
Related commit(s):

The fix will be available with the upcoming 2.3.4 release.

Was this page helpful?
0 / 5 - 0 ratings