Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Noticed exception 'TypeError' when the product_list_order parameter is an array. #37827

Open
1 of 5 tasks
adam-krakowski-accenture opened this issue Aug 1, 2023 · 18 comments · May be fixed by #37854
Open
1 of 5 tasks
Assignees
Labels
Area: SEO Component: Url Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: ready for confirmation Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Priority: P3 May be fixed according to the position in the backlog. Progress: PR in progress Reported on 2.4.4-p4 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch

Comments

@adam-krakowski-accenture

Preconditions and environment

  • Magento version: Adobe Commerce ver. 2.4.4-p4

Steps to reproduce

  1. Go to storefront, then into categories to see the products.
  2. Change the product_list_order parameter in the URL to an array type.
  3. Refresh the page with changed URL.

Examples of URL:
https://release4.proshop.pg.com/whitening/crest-whitestrips.html?product_list_order[]=price&product_list_dir=desc
https://ca.magento2.local/shop-by-product/crest-whitening.html?product_list_order[]

Expected result

The product_list_order parameter with an array type is handled correctly.

vendor/magento/module-catalog/Model/Product/ProductList/ToolbarMemorizer.php
The getOrder() function returns string|bool value as described in the @return tag

Actual result

TypeError: Illegal offset type in isset or empty in /var/www/magento/vendor/magento/module-catalog/Block/Product/ProductList/Toolbar.php:280

vendor/magento/module-catalog/Model/Product/ProductList/ToolbarMemorizer.php
The getOrder() function returns array value (invalid @return tag), which causes a TypeError

Additional information

TypeError: Illegal offset type in isset or empty in /var/www/magento/vendor/magento/module-catalog/Block/Product/ProductList/Toolbar.php:280
Stack trace:
#0 /var/www/magento/app/code/PG/GaGtm/Model/ProductCollection/CategoryCollectionFilter.php(62): Magento\Catalog\Block\Product\ProductList\Toolbar->getCurrentOrder()
#1 /var/www/magento/app/code/PG/GaGtm/Model/ProductCollection/CollectionGetter.php(46): PG\GaGtm\Model\ProductCollection\CategoryCollectionFilter->filter()
#2 /var/www/magento/app/code/PG/GaGtm/Observer/Products/LoadCollection.php(58): PG\GaGtm\Model\ProductCollection\CollectionGetter->getCollection()
#3 /var/www/magento/vendor/magento/framework/Event/Invoker/InvokerDefault.php(88): PG\GaGtm\Observer\Products\LoadCollection->execute()
#4 /var/www/magento/vendor/magento/framework/Event/Invoker/InvokerDefault.php(74): Magento\Framework\Event\Invoker\InvokerDefault->_callObserverMethod()
#5 /var/www/magento/vendor/magento/module-staging/Model/Event/Manager.php(97): Magento\Framework\Event\Invoker\InvokerDefault->dispatch()
#6 /var/www/magento/generated/code/Magento/Staging/Model/Event/Manager/Proxy.php(95): Magento\Staging\Model\Event\Manager->dispatch()
#7 /var/www/magento/vendor/magento/framework/View/Result/Layout.php(169): Magento\Staging\Model\Event\Manager\Proxy->dispatch()
#8 /var/www/magento/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\View\Result\Layout->renderResult()
#9 /var/www/magento/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\View\Result\Page\Interceptor->___callParent()
#10 /var/www/magento/vendor/magezon/module-core/Plugin/View/Result/Layout.php(24): Magento\Framework\View\Result\Page\Interceptor->Magento\Framework\Interception{closure}()
#11 /var/www/magento/vendor/magento/framework/Interception/Interceptor.php(135): Magezon\Core\Plugin\View\Result\Layout->aroundRenderResult()
#12 /var/www/magento/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\View\Result\Page\Interceptor->Magento\Framework\Interception{closure}()
#13 /var/www/magento/generated/code/Magento/Framework/View/Result/Page/Interceptor.php(95): Magento\Framework\View\Result\Page\Interceptor->___callPlugins()
#14 /var/www/magento/vendor/magento/framework/App/Http.php(120): Magento\Framework\View\Result\Page\Interceptor->renderResult()
#15 /var/www/magento/generated/code/Magento/Framework/App/Http/Interceptor.php(23): Magento\Framework\App\Http->launch()
#16 /var/www/magento/vendor/magento/framework/App/Bootstrap.php(267): Magento\Framework\App\Http\Interceptor->launch()
#17 /var/www/magento/pub/index.php(30): Magento\Framework\App\Bootstrap->run()

Release note

No response

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
@m2-assistant
Copy link

m2-assistant bot commented Aug 1, 2023

Hi @adam-krakowski-accenture. Thank you for your report.
To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:


Join Magento Community Engineering Slack and ask your questions in #github channel.
⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
🕙 You can find the schedule on the Magento Community Calendar page.
📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

@engcom-Dash
Copy link
Contributor

@magento give me 2.4-develop instance

@magento-deployment-service
Copy link

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

@magento-deployment-service
Copy link

@engcom-Bravo engcom-Bravo self-assigned this Aug 1, 2023
@m2-assistant
Copy link

m2-assistant bot commented Aug 1, 2023

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: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
  • 3. Add Area: XXXXX label to the ticket, indicating the functional areas it may be related to.
  • 4. Verify that the issue is reproducible on 2.4-develop branch
    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.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. Add label Issue: Confirmed once verification is complete.
  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@engcom-Bravo engcom-Bravo added the Reported on 2.4.4-p4 Indicates original Magento version for the Issue report. label Aug 1, 2023
@engcom-Bravo
Copy link
Contributor

Hi @adam-krakowski-accenture,

Thank you for reporting and collaboration.

Verified the issue on Magento 2.4-develop instance and the issue is not reproducible.Kindly refer the attached video.

Steps to reproduce

  • Go to storefront, then into categories to see the products.
  • Change the product_list_order parameter in the URL to an array type.
  • Refresh the page with changed URL.

We are not getting any exception after changing the URL could you please let us know if we are missing anything.

Untitled.32.mp4

Kindly recheck the behaviour on Magento 2.4-develop instance and elaborate steps to reproduce if the issue is still reproducible.

Thanks.

@engcom-Bravo engcom-Bravo added the Issue: needs update Additional information is require, waiting for response label Aug 2, 2023
@adam-krakowski-accenture
Copy link
Author

adam-krakowski-accenture commented Aug 2, 2023

Hello @engcom-Bravo,
Thank you for contact. Please try to change URL with sign "?" also. On the video I see that you are trying for example "product_list_order[]" instead "?product_list_order[] after ".html" so at the end of URL should be
".html?product_list_order[]".
Thanks

@engcom-Bravo
Copy link
Contributor

@magento give me 2.4-develop instance

@magento-deployment-service
Copy link

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

@magento-deployment-service
Copy link

@engcom-Bravo
Copy link
Contributor

Hi @adam-krakowski-accenture,

Thanks for your update.

Verified the issue on Magento 2.4-develop instance and the issue is reproducible. Kindly refer the attached video.

Steps to reproduce

  • Go to storefront, then into categories to see the products.
  • Change the product_list_order parameter in the URL to an array type.
  • Refresh the page with changed URL.

After changing the URL to an array type we are getting exception An error has happened during application run. See exception log for details.

Screenshot 2023-08-03 at 5 04 29 PM
Untitled.33.mp4

Hence Confirming the issue.

Thanks.

@engcom-Bravo engcom-Bravo removed the Issue: needs update Additional information is require, waiting for response label Aug 3, 2023
@engcom-Bravo engcom-Bravo added Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed and removed Issue: ready for confirmation labels Aug 3, 2023
@jenyatrishin
Copy link

@magento I am working on this

@m2-assistant
Copy link

m2-assistant bot commented Aug 4, 2023

Hi @jenyatrishin! 👋
Thank you for collaboration. Only members of Community Contributors Team are allowed to be assigned to the issue. Please use @magento add to contributors team command to join Contributors team.

@jenyatrishin
Copy link

@magento add to contributors team

@m2-assistant
Copy link

m2-assistant bot commented Aug 4, 2023

Hi @jenyatrishin! 👋
Thank you for joining. Please accept team invitation 👉 here 👈 and add your comment one more time.

@jenyatrishin
Copy link

@magento I am working on this

@jenyatrishin jenyatrishin linked a pull request Aug 7, 2023 that will close this issue
5 tasks
@github-jira-sync-bot github-jira-sync-bot added Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Priority: P3 May be fixed according to the position in the backlog. and removed Priority: P3 May be fixed according to the position in the backlog. Priority: P2 A defect with this priority could have functionality issues which are not to expectations. labels Aug 8, 2023
@m2-community-project m2-community-project bot added the Priority: P2 A defect with this priority could have functionality issues which are not to expectations. label Aug 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: SEO Component: Url Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: ready for confirmation Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Priority: P3 May be fixed according to the position in the backlog. Progress: PR in progress Reported on 2.4.4-p4 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch
Projects
Status: Pull Request In Progress
Development

Successfully merging a pull request may close this issue.

5 participants