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

Warning: A non-numeric value encountered in vendor/magento/module-checkout/Controller/Sidebar/UpdateItemQty.php on line 69 #34380

Closed
1 of 5 tasks
Morgy93 opened this issue Oct 19, 2021 · 17 comments · Fixed by #34953
Assignees
Labels
Area: Cart & Checkout Component: Url Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: done Reported on 2.4.3 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

@Morgy93
Copy link
Member

Morgy93 commented Oct 19, 2021

Preconditions (*)

Magento 2.4.3

Steps to reproduce (*)

  1. Open https://domain.com/checkout/sidebar/updateItemQty/?item_qty=error
  2. See 500 error

Expected result (*)

No 500 error

Actual result (*)

Warning: A non-numeric value encountered in /vendor/magento/module-checkout/Controller/Sidebar/UpdateItemQty.php on line 69


Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

  • 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 Oct 19, 2021

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

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • 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.4-develop instance - upcoming 2.4.x release

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

Please, add a comment to assign the issue: @magento I am working on this


⚠️ 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, please join the Community Contributions Triage session to discuss the appropriate ticket.

🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

@Morgy93
Copy link
Member Author

Morgy93 commented Oct 19, 2021

@magento give me 2.4-develop instance

@magento-deployment-service
Copy link

Hi @Morgy93. Thank you for your request. I'm working on Magento instance for you.

@magento-deployment-service
Copy link

@Morgy93
Copy link
Member Author

Morgy93 commented Oct 19, 2021

@Morgy93
Copy link
Member Author

Morgy93 commented Oct 19, 2021

It's also possible to trigger:

Notice: A non well formed numeric value encountered in vendor/magento/module-checkout/Controller/Sidebar/UpdateItemQty.php on line 69

Just for reference~

@engcom-November engcom-November self-assigned this Oct 19, 2021
@m2-assistant
Copy link

m2-assistant bot commented Oct 19, 2021

Hi @engcom-November. 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).

    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.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-November
Copy link

Verified the issue on Magento 2.4-develop branch and the issue is reproducible:
Magento Store front - On navigating to /checkout/sidebar/updateItemQty/?item_qty=error, exception is thrown
image

[2021-10-19T10:34:03.224752+00:00] main.ERROR: Warning: A non-numeric value encountered in /var/www/html/mg24/magento2/app/code/Magento/Checkout/Controller/Sidebar/UpdateItemQty.php on line 69 [] []
[2021-10-19T10:34:03.226560+00:00] main.CRITICAL: Exception: Warning: A non-numeric value encountered in /var/www/html/mg24/magento2/app/code/Magento/Checkout/Controller/Sidebar/UpdateItemQty.php on line 69 in /var/www/html/mg24/magento2/lib/internal/Magento/Framework/App/ErrorHandler.php:61
Stack trace:
#0 /var/www/html/mg24/magento2/app/code/Magento/Checkout/Controller/Sidebar/UpdateItemQty.php(69): Magento\Framework\App\ErrorHandler->handler()
#1 /var/www/html/mg24/magento2/lib/internal/Magento/Framework/Interception/Interceptor.php(58): Magento\Checkout\Controller\Sidebar\UpdateItemQty->execute()
#2 /var/www/html/mg24/magento2/lib/internal/Magento/Framework/Interception/Interceptor.php(138): Magento\Checkout\Controller\Sidebar\UpdateItemQty\Interceptor->___callParent()
#3 /var/www/html/mg24/magento2/lib/internal/Magento/Framework/Interception/Interceptor.php(153): Magento\Checkout\Controller\Sidebar\UpdateItemQty\Interceptor->Magento\Framework\Interception\{closure}()
#4 /var/www/html/mg24/magento2/generated/code/Magento/Checkout/Controller/Sidebar/UpdateItemQty/Interceptor.php(23): Magento\Checkout\Controller\Sidebar\UpdateItemQty\Interceptor->___callPlugins()
#5 /var/www/html/mg24/magento2/lib/internal/Magento/Framework/App/Action/Action.php(111): Magento\Checkout\Controller\Sidebar\UpdateItemQty\Interceptor->execute()
#6 /var/www/html/mg24/magento2/lib/internal/Magento/Framework/Interception/Interceptor.php(58): Magento\Framework\App\Action\Action->dispatch()
#7 /var/www/html/mg24/magento2/lib/internal/Magento/Framework/Interception/Interceptor.php(138): Magento\Checkout\Controller\Sidebar\UpdateItemQty\Interceptor->___callParent()
#8 /var/www/html/mg24/magento2/lib/internal/Magento/Framework/Interception/Interceptor.php(153): Magento\Checkout\Controller\Sidebar\UpdateItemQty\Interceptor->Magento\Framework\Interception\{closure}()
#9 /var/www/html/mg24/magento2/generated/code/Magento/Checkout/Controller/Sidebar/UpdateItemQty/Interceptor.php(32): Magento\Checkout\Controller\Sidebar\UpdateItemQty\Interceptor->___callPlugins()
#10 /var/www/html/mg24/magento2/lib/internal/Magento/Framework/App/FrontController.php(245): Magento\Checkout\Controller\Sidebar\UpdateItemQty\Interceptor->dispatch()
#11 /var/www/html/mg24/magento2/lib/internal/Magento/Framework/App/FrontController.php(212): Magento\Framework\App\FrontController->getActionResponse()
#12 /var/www/html/mg24/magento2/lib/internal/Magento/Framework/App/FrontController.php(147): Magento\Framework\App\FrontController->processRequest()
#13 /var/www/html/mg24/magento2/lib/internal/Magento/Framework/Interception/Interceptor.php(58): Magento\Framework\App\FrontController->dispatch()
#14 /var/www/html/mg24/magento2/lib/internal/Magento/Framework/Interception/Interceptor.php(138): Magento\Framework\App\FrontController\Interceptor->___callParent()
#15 /var/www/html/mg24/magento2/app/code/Magento/Store/App/FrontController/Plugin/RequestPreprocessor.php(99): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}()
#16 /var/www/html/mg24/magento2/lib/internal/Magento/Framework/Interception/Interceptor.php(135): Magento\Store\App\FrontController\Plugin\RequestPreprocessor->aroundDispatch()
#17 /var/www/html/mg24/magento2/app/code/Magento/PageCache/Model/App/FrontController/BuiltinPlugin.php(75): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}()
#18 /var/www/html/mg24/magento2/lib/internal/Magento/Framework/Interception/Interceptor.php(135): Magento\PageCache\Model\App\FrontController\BuiltinPlugin->aroundDispatch()
#19 /var/www/html/mg24/magento2/lib/internal/Magento/Framework/Interception/Interceptor.php(153): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}()
#20 /var/www/html/mg24/magento2/generated/code/Magento/Framework/App/FrontController/Interceptor.php(23): Magento\Framework\App\FrontController\Interceptor->___callPlugins()
#21 /var/www/html/mg24/magento2/lib/internal/Magento/Framework/App/Http.php(116): Magento\Framework\App\FrontController\Interceptor->dispatch()
#22 /var/www/html/mg24/magento2/lib/internal/Magento/Framework/App/Bootstrap.php(264): Magento\Framework\App\Http->launch()
#23 /var/www/html/mg24/magento2/pub/index.php(30): Magento\Framework\App\Bootstrap->run()
#24 {main} {"report_id":"ad1af67362008d935c12f9ed1cc971ffeb185a9f74188e792c9696a4e9af79f8"} []

@engcom-November engcom-November added Area: Cart & Checkout Component: Url Reported on 2.4.3 Indicates original Magento version for the Issue report. 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 labels Oct 19, 2021
@m2-community-project m2-community-project bot moved this from Ready for Confirmation to Confirmed in Issue Confirmation and Triage Board Oct 19, 2021
@github-jira-sync-bot
Copy link

✅ Jira issue https://jira.corp.magento.com/browse/AC-1518 is successfully created for this GitHub issue.

@m2-assistant
Copy link

m2-assistant bot commented Oct 19, 2021

✅ Confirmed by @engcom-November. Thank you for verifying the issue.
Issue Available: @engcom-November, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

@engcom-Alfa engcom-Alfa added the Priority: P4 No current plan to fix. Fixing can be deferred as a logical part of more important work. label Oct 26, 2021
@m2-community-project m2-community-project bot added this to Ready for Development in Low Priority Backlog Oct 26, 2021
@Melnychuk-Alexandr
Copy link
Contributor

@magento I am working on this

@Melnychuk-Alexandr
Copy link
Contributor

Hi @Morgy93 How did you get this url ? How did you get the value of "item_qty" string "error" ? Thanks!

@Melnychuk-Alexandr
Copy link
Contributor

Hello @sidolov
This problem is reproducible and I think it serious problem.
I think we need to add additional validation for input params in controller.
If input params are invalid or request type (in the issue request type is GET instead of POST) is wrong we need to output message about it. For example "This link is not valid".
I think this is P1 or P2 priority issue.
Could you please help me with it.
Thank you in advance.

@sidolov sidolov added Priority: P2 A defect with this priority could have functionality issues which are not to expectations. and removed Priority: P4 No current plan to fix. Fixing can be deferred as a logical part of more important work. labels Jan 11, 2022
@m2-community-project m2-community-project bot added this to Pull Request In Progress in High Priority Backlog Jan 11, 2022
@m2-community-project m2-community-project bot removed this from Pull Request In Progress in Low Priority Backlog Jan 11, 2022
@hardiksinh
Copy link

I get similar issue when trying Update Attribute action from products grid on admin side in Magento 2.4.3.

Exception #0 (Exception): Warning: A non-numeric value encountered in /var/www/html/magento2/vendor/magento/module-inventory-catalog-admin-ui/view/adminhtml/templates/catalog/product/edit/action/inventory.phtml on line 296
Typecasting below to integer fixes the issue:
old:
value="<?= $block->getDefaultConfigValue('notify_stock_qty') * 1 ?>"
new:
value="<?= (int) $block->getDefaultConfigValue('notify_stock_qty') * 1 ?>"

@Melnychuk-Alexandr
Copy link
Contributor

Hi @hardiksinh thank you for your comment! Please give me more information, for example: steps to reproduced.

@hardiksinh
Copy link

@Melnychuk-Alexandr Steps are really straight-forward to reproduce issue:

  1. Login to admin panel of your Magento 2.4.3
  2. Click on Catalog -> Products menu to go the products grid
  3. Select products from the grid either by "Select All" or "Select All on This Page" or manually checking checkbox of product.
  4. From the Actions drop-down on product grid, choose "Update Attributes".

If you are in developer mode, the page shows error as below:
Exception #0 (Exception): Warning: A non-numeric value encountered in /var/www/html/magento2/vendor/magento/module-inventory-catalog-admin-ui/view/adminhtml/templates/catalog/product/edit/action/inventory.phtml on line 296

@Melnychuk-Alexandr
Copy link
Contributor

Hi @hardiksinh, thank you for your answer!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Cart & Checkout Component: Url Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: done Reported on 2.4.3 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
Development

Successfully merging a pull request may close this issue.

7 participants