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

Mass attribute update fails with E_WARNING #17592

Closed
sabl0r opened this issue Aug 14, 2018 · 10 comments
Closed

Mass attribute update fails with E_WARNING #17592

sabl0r opened this issue Aug 14, 2018 · 10 comments
Labels
Component: Catalog Event: lviv-meetup Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release

Comments

@sabl0r
Copy link

sabl0r commented Aug 14, 2018

Preconditions

Magento 2.2.5
PHP 7.1.20

Steps to reproduce.

  1. Add some values to «Catalog» → «Inventory» → «Product Stock Options» → «Minimum Qty Allowed in Shopping Cart».
  2. Flush cache.
  3. Go to the Catalog => Products
  4. Select some products in the list
  5. Select "Update attributes" in the action dropdown

Expected result

The form to update all available attributes should be shown.

Actual result

PHP throws an E_WARNING:

1 exception(s):
Exception #0 (Exception): Warning: A non-numeric value encountered in /var/www/foo.de/htdocs/shop/vendor/magento/module-catalog/view/adminhtml/templates/catalog/product/edit/action/inventory.phtml on line 135

Exception #0 (Exception): Warning: A non-numeric value encountered in /var/www/foo.de/htdocs/shop/vendor/magento/module-catalog/view/adminhtml/templates/catalog/product/edit/action/inventory.phtml on line 135
#0 /var/www/foo.de/htdocs/shop/vendor/magento/module-catalog/view/adminhtml/templates/catalog/product/edit/action/inventory.phtml(135): Magento\Framework\App\ErrorHandler->handler(2, 'A non-numeric v...', '/var/www/dev.bl...', 135, Array)
#1 /var/www/foo.de/htdocs/shop/vendor/magento/framework/View/TemplateEngine/Php.php(59): include('/var/www/dev.bl...')
#2 /var/www/foo.de/htdocs/shop/vendor/magento/framework/View/Element/Template.php(270): Magento\Framework\View\TemplateEngine\Php->render(Object(Magento\Catalog\Block\Adminhtml\Product\Edit\Action\Attribute\Tab\Inventory), '/var/www/dev.bl...', Array)
#3 /var/www/foo.de/htdocs/shop/vendor/magento/framework/View/Element/Template.php(300): Magento\Framework\View\Element\Template->fetchView('/var/www/dev.bl...')
#4 /var/www/foo.de/htdocs/shop/vendor/magento/module-backend/Block/Template.php(124): Magento\Framework\View\Element\Template->_toHtml()
#5 /var/www/foo.de/htdocs/shop/vendor/magento/framework/View/Element/AbstractBlock.php(667): Magento\Backend\Block\Template->_toHtml()
#6 /var/www/foo.de/htdocs/shop/vendor/magento/module-backend/Block/Widget/Tabs.php(390): Magento\Framework\View\Element\AbstractBlock->toHtml()
#7 /var/www/foo.de/htdocs/shop/vendor/magento/module-backend/view/adminhtml/templates/widget/tabs.phtml(57): Magento\Backend\Block\Widget\Tabs->getTabContent(Object(Magento\Catalog\Block\Adminhtml\Product\Edit\Action\Attribute\Tab\Inventory))
#8 /var/www/foo.de/htdocs/shop/vendor/magento/framework/View/TemplateEngine/Php.php(59): include('/var/www/dev.bl...')
#9 /var/www/foo.de/htdocs/shop/vendor/magento/framework/View/Element/Template.php(270): Magento\Framework\View\TemplateEngine\Php->render(Object(Magento\Catalog\Block\Adminhtml\Product\Edit\Action\Attribute\Tabs), '/var/www/dev.bl...', Array)
#10 /var/www/foo.de/htdocs/shop/vendor/magento/framework/View/Element/Template.php(300): Magento\Framework\View\Element\Template->fetchView('/var/www/dev.bl...')
#11 /var/www/foo.de/htdocs/shop/vendor/magento/module-backend/Block/Template.php(124): Magento\Framework\View\Element\Template->_toHtml()
#12 /var/www/foo.de/htdocs/shop/vendor/magento/framework/View/Element/AbstractBlock.php(667): Magento\Backend\Block\Template->_toHtml()
#13 /var/www/foo.de/htdocs/shop/vendor/magento/framework/View/Layout.php(558): Magento\Framework\View\Element\AbstractBlock->toHtml()
#14 /var/www/foo.de/htdocs/shop/vendor/magento/framework/View/Layout.php(534): Magento\Framework\View\Layout->_renderBlock('attributes_tabs')
#15 /var/www/foo.de/htdocs/shop/generated/code/Magento/Framework/View/Layout/Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('attributes_tabs')
#16 /var/www/foo.de/htdocs/shop/vendor/magento/framework/View/Layout.php(489): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('attributes_tabs')
#17 /var/www/foo.de/htdocs/shop/generated/code/Magento/Framework/View/Layout/Interceptor.php(193): Magento\Framework\View\Layout->renderElement('attributes_tabs', true)
#18 /var/www/foo.de/htdocs/shop/vendor/magento/framework/View/Layout.php(585): Magento\Framework\View\Layout\Interceptor->renderElement('attributes_tabs')
#19 /var/www/foo.de/htdocs/shop/vendor/magento/framework/View/Layout.php(536): Magento\Framework\View\Layout->_renderContainer('left')
#20 /var/www/foo.de/htdocs/shop/generated/code/Magento/Framework/View/Layout/Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('left')
#21 /var/www/foo.de/htdocs/shop/vendor/magento/framework/View/Layout.php(489): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('left')
#22 /var/www/foo.de/htdocs/shop/generated/code/Magento/Framework/View/Layout/Interceptor.php(193): Magento\Framework\View\Layout->renderElement('left', true)
#23 /var/www/foo.de/htdocs/shop/vendor/magento/framework/View/Layout.php(585): Magento\Framework\View\Layout\Interceptor->renderElement('left')
#24 /var/www/foo.de/htdocs/shop/vendor/magento/framework/View/Layout.php(536): Magento\Framework\View\Layout->_renderContainer('side.col')
#25 /var/www/foo.de/htdocs/shop/generated/code/Magento/Framework/View/Layout/Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('side.col')
#26 /var/www/foo.de/htdocs/shop/vendor/magento/framework/View/Layout.php(489): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('side.col')
#27 /var/www/foo.de/htdocs/shop/generated/code/Magento/Framework/View/Layout/Interceptor.php(193): Magento\Framework\View\Layout->renderElement('side.col', true)
#28 /var/www/foo.de/htdocs/shop/vendor/magento/framework/View/Layout.php(585): Magento\Framework\View\Layout\Interceptor->renderElement('side.col')
#29 /var/www/foo.de/htdocs/shop/vendor/magento/framework/View/Layout.php(536): Magento\Framework\View\Layout->_renderContainer('page.main.conta...')
#30 /var/www/foo.de/htdocs/shop/generated/code/Magento/Framework/View/Layout/Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('page.main.conta...')
#31 /var/www/foo.de/htdocs/shop/vendor/magento/framework/View/Layout.php(489): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('page.main.conta...')
#32 /var/www/foo.de/htdocs/shop/generated/code/Magento/Framework/View/Layout/Interceptor.php(193): Magento\Framework\View\Layout->renderElement('page.main.conta...', true)
#33 /var/www/foo.de/htdocs/shop/vendor/magento/framework/View/Layout.php(585): Magento\Framework\View\Layout\Interceptor->renderElement('page.main.conta...')
#34 /var/www/foo.de/htdocs/shop/vendor/magento/framework/View/Layout.php(536): Magento\Framework\View\Layout->_renderContainer('page.content')
#35 /var/www/foo.de/htdocs/shop/generated/code/Magento/Framework/View/Layout/Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('page.content')
#36 /var/www/foo.de/htdocs/shop/vendor/magento/framework/View/Layout.php(489): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('page.content')
#37 /var/www/foo.de/htdocs/shop/generated/code/Magento/Framework/View/Layout/Interceptor.php(193): Magento\Framework\View\Layout->renderElement('page.content', true)
#38 /var/www/foo.de/htdocs/shop/vendor/magento/framework/View/Layout.php(585): Magento\Framework\View\Layout\Interceptor->renderElement('page.content')
#39 /var/www/foo.de/htdocs/shop/vendor/magento/framework/View/Layout.php(536): Magento\Framework\View\Layout->_renderContainer('page.wrapper')
#40 /var/www/foo.de/htdocs/shop/generated/code/Magento/Framework/View/Layout/Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('page.wrapper')
#41 /var/www/foo.de/htdocs/shop/vendor/magento/framework/View/Layout.php(489): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('page.wrapper')
#42 /var/www/foo.de/htdocs/shop/generated/code/Magento/Framework/View/Layout/Interceptor.php(193): Magento\Framework\View\Layout->renderElement('page.wrapper', true)
#43 /var/www/foo.de/htdocs/shop/vendor/magento/framework/View/Layout.php(585): Magento\Framework\View\Layout\Interceptor->renderElement('page.wrapper')
#44 /var/www/foo.de/htdocs/shop/vendor/magento/framework/View/Layout.php(536): Magento\Framework\View\Layout->_renderContainer('backend.page')
#45 /var/www/foo.de/htdocs/shop/generated/code/Magento/Framework/View/Layout/Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('backend.page')
#46 /var/www/foo.de/htdocs/shop/vendor/magento/framework/View/Layout.php(489): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('backend.page')
#47 /var/www/foo.de/htdocs/shop/generated/code/Magento/Framework/View/Layout/Interceptor.php(193): Magento\Framework\View\Layout->renderElement('backend.page', true)
#48 /var/www/foo.de/htdocs/shop/vendor/magento/framework/View/Layout.php(585): Magento\Framework\View\Layout\Interceptor->renderElement('backend.page')
#49 /var/www/foo.de/htdocs/shop/vendor/magento/framework/View/Layout.php(536): Magento\Framework\View\Layout->_renderContainer('root')
#50 /var/www/foo.de/htdocs/shop/generated/code/Magento/Framework/View/Layout/Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('root')
#51 /var/www/foo.de/htdocs/shop/vendor/magento/framework/View/Layout.php(489): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('root')
#52 /var/www/foo.de/htdocs/shop/generated/code/Magento/Framework/View/Layout/Interceptor.php(193): Magento\Framework\View\Layout->renderElement('root', true)
#53 /var/www/foo.de/htdocs/shop/vendor/magento/framework/View/Layout.php(954): Magento\Framework\View\Layout\Interceptor->renderElement('root')
#54 /var/www/foo.de/htdocs/shop/generated/code/Magento/Framework/View/Layout/Interceptor.php(492): Magento\Framework\View\Layout->getOutput()
#55 /var/www/foo.de/htdocs/shop/vendor/magento/framework/View/Result/Page.php(257): Magento\Framework\View\Layout\Interceptor->getOutput()
#56 /var/www/foo.de/htdocs/shop/vendor/magento/framework/View/Result/Layout.php(170): Magento\Framework\View\Result\Page->render(Object(Magento\Framework\App\Response\Http\Interceptor))
#57 /var/www/foo.de/htdocs/shop/generated/code/Magento/Backend/Model/View/Result/Page/Interceptor.php(193): Magento\Framework\View\Result\Layout->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))
#58 /var/www/foo.de/htdocs/shop/vendor/magento/framework/App/Http.php(139): Magento\Backend\Model\View\Result\Page\Interceptor->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))
#59 /var/www/foo.de/htdocs/shop/generated/code/Magento/Framework/App/Http/Interceptor.php(24): Magento\Framework\App\Http->launch()
#60 /var/www/foo.de/htdocs/shop/vendor/magento/framework/App/Bootstrap.php(256): Magento\Framework\App\Http\Interceptor->launch()
#61 /var/www/foo.de/htdocs/shop/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))
#62 {main}

Root cause

Min quantity is an array and not an integer value as the UI suggests:

screenshot 2018-08-14 11 03 28-001

Therefore this code fails:
File: vendor/magento/module-catalog/view/adminhtml/templates/catalog/product/edit/action/inventory.phtml

<input type="text" class="input-text validate-number" id="inventory_min_qty"
       name="<?= /* @escapeNotVerified */ $block->getFieldSuffix() ?>[min_qty]"
       value="<?= /* @escapeNotVerified */ $block->getDefaultConfigValue('min_qty') * 1 ?>" disabled="disabled"/>

Workaround

Remove the * 1 from the mentioned code.

@magento-engcom-team
Copy link
Contributor

Hi @sabl0r. 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-engcom-team give me {$VERSION} instance

where {$VERSION} is version tags (starting from 2.2.0+) or develop branches (2.2-develop +).
For more details, please, review the Magento Contributor Assistant documentation.

@sabl0r do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • yes
  • no

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Aug 14, 2018
@ghost ghost self-assigned this Aug 14, 2018
@ghost
Copy link

ghost commented Aug 14, 2018

@sabl0r, thank you for your report.
We've acknowledged the issue and added to our backlog.

@ghost ghost added Progress: needs update Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Component: Catalog Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release and removed Progress: needs update labels Aug 14, 2018
@ghost ghost removed their assignment Aug 14, 2018
@dmytro-ch dmytro-ch assigned dmytro-ch and unassigned dmytro-ch Aug 19, 2018
@Yupik Yupik assigned Yupik and unassigned Yupik Sep 9, 2018
@Dmutryk
Copy link

Dmutryk commented Sep 15, 2018

#lviv-meetup

@magento-engcom-team
Copy link
Contributor

@Dmutryk thank you for joining. Please accept team invitation here and self-assign the issue.

@Yupik
Copy link
Contributor

Yupik commented Sep 15, 2018

@Dmutryk sadly removing * 1 doesn't solve problem, because min_sale_qty is an array of options. Option for min_sale_qty should be displayed like in store default configuration.

@pratikmage
Copy link

pratikmage commented Sep 24, 2018

Hello @Dmutryk and @Yupik you can fix this issue using add int on line number 135 for example

value="<?= /* @escapeNotVerified */ (int)$block->getDefaultConfigValue('min_sale_qty') * 1 ?>"

pmclain added a commit to pmclain/magento2 that referenced this issue Nov 15, 2018
Resolves warning when using the product edit mass-action after configuring
global group cart min qty

Fixes magento#17592
@magento-engcom-team
Copy link
Contributor

Hi @pmclain. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if your want to validate it one more time, please, go though the following instruction:

  • 1. Add/Edit Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 2. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento-engcom-team 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!

  • 3. Verify that the issue is reproducible on 2.2-develop branch.

    Details- Add the comment @magento-engcom-team 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

  • 4. If the issue is not relevant or is not reproducible any more, feel free to close it.

@magento-engcom-team
Copy link
Contributor

Hi @sabl0r. Thank you for your report.
The issue has been fixed in #19095 by @pmclain in 2.3-develop branch
Related commit(s):

The fix will be available with the upcoming 2.3.1 release.

@magento-engcom-team magento-engcom-team added the Fixed in 2.3.x The issue has been fixed in 2.3 release line label Jan 26, 2019
@sivaschenko sivaschenko reopened this Mar 6, 2019
@sivaschenko
Copy link
Member

The pull request #19095 was reverted, see details here: #19095 (comment)

@magento-engcom-team
Copy link
Contributor

Hi @sabl0r.

Thank you for your report and collaboration!

The issue was fixed by Magento team.

The fix will be available with the upcoming 2.3.3 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Catalog Event: lviv-meetup Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release
Projects
None yet
Development

No branches or pull requests

9 participants