We just managed to upgrade Magento Open Source from Version-2.2.1 to 2.2.4 and the upgrade went pretty well after multiple attempts. Now we are stuck with one problem, we can add items to the carts and are able to successfully checkout. But the problem comes when we try to view the cart, it will throw the following error's. Anybody faced the same issue ??
Platform:
O.S: Ubuntu-20.04
Php-7.4
Mariadb-10.4
Apache-2.4
Please find the error Screenshot below 👇
==============================================================
1 exception(s):
Exception #0 (Exception): Notice: Array to string conversion in /var/www/html/app/design/frontend/Sm/styleshop/Magento_Catalog/templates/product/image_with_borders.phtml on line 12
Exception #0 (Exception): Notice: Array to string conversion in /var/www/html/app/design/frontend/Sm/styleshop/Magento_Catalog/templates/product/image_with_borders.phtml on line 12
#1 include() called at [vendor/magento/framework/View/TemplateEngine/Php.php:71]
#2 Magento\Framework\View\TemplateEngine\Php->render() called at [vendor/magento/framework/View/Element/Template.php:273]
#3 Magento\Framework\View\Element\Template->fetchView() called at [vendor/magento/framework/View/Element/Template.php:303]
#4 Magento\Framework\View\Element\Template->_toHtml() called at [vendor/magento/framework/View/Element/AbstractBlock.php:1111]
#5 Magento\Framework\View\Element\AbstractBlock->Magento\Framework\View\Element\{closure}() called at [vendor/magento/framework/View/Element/AbstractBlock.php:1115]
#6 Magento\Framework\View\Element\AbstractBlock->_loadCache() called at [vendor/magento/framework/View/Element/AbstractBlock.php:675]
#7 Magento\Framework\View\Element\AbstractBlock->toHtml() called at [app/design/frontend/Sm/styleshop/Magento_Checkout/templates/cart/item/default.phtml:63]
#8 include() called at [vendor/magento/framework/View/TemplateEngine/Php.php:71]
#9 Magento\Framework\View\TemplateEngine\Php->render() called at [vendor/magento/framework/View/Element/Template.php:273]
#10 Magento\Framework\View\Element\Template->fetchView() called at [vendor/magento/framework/View/Element/Template.php:303]
#11 Magento\Framework\View\Element\Template->_toHtml() called at [vendor/magento/framework/View/Element/AbstractBlock.php:1111]
#12 Magento\Framework\View\Element\AbstractBlock->Magento\Framework\View\Element\{closure}() called at [vendor/magento/framework/View/Element/AbstractBlock.php:1115]
#13 Magento\Framework\View\Element\AbstractBlock->_loadCache() called at [vendor/magento/framework/View/Element/AbstractBlock.php:675]
#14 Magento\Framework\View\Element\AbstractBlock->toHtml() called at [vendor/magento/module-checkout/Block/Cart/AbstractCart.php:134]
#15 Magento\Checkout\Block\Cart\AbstractCart->getItemHtml() called at [app/design/frontend/Sm/styleshop/Magento_Checkout/templates/cart/form.phtml:39]
#16 include() called at [vendor/magento/framework/View/TemplateEngine/Php.php:71]
#17 Magento\Framework\View\TemplateEngine\Php->render() called at [vendor/magento/framework/View/Element/Template.php:273]
#18 Magento\Framework\View\Element\Template->fetchView() called at [vendor/magento/framework/View/Element/Template.php:303]
#19 Magento\Framework\View\Element\Template->_toHtml() called at [vendor/magento/framework/View/Element/AbstractBlock.php:1111]
#20 Magento\Framework\View\Element\AbstractBlock->Magento\Framework\View\Element\{closure}() called at [vendor/magento/framework/View/Element/AbstractBlock.php:1115]
#21 Magento\Framework\View\Element\AbstractBlock->_loadCache() called at [vendor/magento/framework/View/Element/AbstractBlock.php:675]
#22 Magento\Framework\View\Element\AbstractBlock->toHtml() called at [vendor/magento/framework/View/Layout.php:578]
#23 Magento\Framework\View\Layout->_renderBlock() called at [vendor/magento/framework/View/Layout.php:555]
#24 Magento\Framework\View\Layout->renderNonCachedElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:149]
#25 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement() called at [vendor/magento/framework/View/Layout.php:510]
#26 Magento\Framework\View\Layout->renderElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:140]
#27 Magento\Framework\View\Layout\Interceptor->renderElement() called at [vendor/magento/framework/View/Layout.php:606]
#28 Magento\Framework\View\Layout->_renderContainer() called at [vendor/magento/framework/View/Layout.php:557]
#29 Magento\Framework\View\Layout->renderNonCachedElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:149]
#30 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement() called at [vendor/magento/framework/View/Layout.php:510]
#31 Magento\Framework\View\Layout->renderElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:140]
#32 Magento\Framework\View\Layout\Interceptor->renderElement() called at [vendor/magento/framework/View/Layout.php:606]
#33 Magento\Framework\View\Layout->_renderContainer() called at [vendor/magento/framework/View/Layout.php:557]
#34 Magento\Framework\View\Layout->renderNonCachedElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:149]
#35 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement() called at [vendor/magento/framework/View/Layout.php:510]
#36 Magento\Framework\View\Layout->renderElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:140]
#37 Magento\Framework\View\Layout\Interceptor->renderElement() called at [vendor/magento/framework/View/Element/AbstractBlock.php:522]
#38 Magento\Framework\View\Element\AbstractBlock->getChildHtml() called at [vendor/magento/module-checkout/view/frontend/templates/cart.phtml:16]
#39 include() called at [vendor/magento/framework/View/TemplateEngine/Php.php:71]
#40 Magento\Framework\View\TemplateEngine\Php->render() called at [vendor/magento/framework/View/Element/Template.php:273]
#41 Magento\Framework\View\Element\Template->fetchView() called at [vendor/magento/framework/View/Element/Template.php:303]
#42 Magento\Framework\View\Element\Template->_toHtml() called at [vendor/magento/framework/View/Element/AbstractBlock.php:1111]
#43 Magento\Framework\View\Element\AbstractBlock->Magento\Framework\View\Element\{closure}() called at [vendor/magento/framework/View/Element/AbstractBlock.php:1115]
#44 Magento\Framework\View\Element\AbstractBlock->_loadCache() called at [vendor/magento/framework/View/Element/AbstractBlock.php:675]
#45 Magento\Framework\View\Element\AbstractBlock->toHtml() called at [vendor/magento/framework/View/Layout.php:578]
#46 Magento\Framework\View\Layout->_renderBlock() called at [vendor/magento/framework/View/Layout.php:555]
#47 Magento\Framework\View\Layout->renderNonCachedElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:149]
#48 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement() called at [vendor/magento/framework/View/Layout.php:510]
#49 Magento\Framework\View\Layout->renderElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:140]
#50 Magento\Framework\View\Layout\Interceptor->renderElement() called at [vendor/magento/framework/View/Layout.php:606]
#51 Magento\Framework\View\Layout->_renderContainer() called at [vendor/magento/framework/View/Layout.php:557]
#52 Magento\Framework\View\Layout->renderNonCachedElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:149]
#53 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement() called at [vendor/magento/framework/View/Layout.php:510]
#54 Magento\Framework\View\Layout->renderElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:140]
#55 Magento\Framework\View\Layout\Interceptor->renderElement() called at [vendor/magento/framework/View/Layout.php:606]
#56 Magento\Framework\View\Layout->_renderContainer() called at [vendor/magento/framework/View/Layout.php:557]
#57 Magento\Framework\View\Layout->renderNonCachedElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:149]
#58 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement() called at [vendor/magento/framework/View/Layout.php:510]
#59 Magento\Framework\View\Layout->renderElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:140]
#60 Magento\Framework\View\Layout\Interceptor->renderElement() called at [vendor/magento/framework/View/Layout.php:606]
#61 Magento\Framework\View\Layout->_renderContainer() called at [vendor/magento/framework/View/Layout.php:557]
#62 Magento\Framework\View\Layout->renderNonCachedElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:149]
#63 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement() called at [vendor/magento/framework/View/Layout.php:510]
#64 Magento\Framework\View\Layout->renderElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:140]
#65 Magento\Framework\View\Layout\Interceptor->renderElement() called at [vendor/magento/framework/View/Layout.php:606]
#66 Magento\Framework\View\Layout->_renderContainer() called at [vendor/magento/framework/View/Layout.php:557]
#67 Magento\Framework\View\Layout->renderNonCachedElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:149]
#68 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement() called at [vendor/magento/framework/View/Layout.php:510]
#69 Magento\Framework\View\Layout->renderElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:140]
#70 Magento\Framework\View\Layout\Interceptor->renderElement() called at [vendor/magento/framework/View/Layout.php:606]
#71 Magento\Framework\View\Layout->_renderContainer() called at [vendor/magento/framework/View/Layout.php:557]
#72 Magento\Framework\View\Layout->renderNonCachedElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:149]
#73 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement() called at [vendor/magento/framework/View/Layout.php:510]
#74 Magento\Framework\View\Layout->renderElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:140]
#75 Magento\Framework\View\Layout\Interceptor->renderElement() called at [vendor/magento/framework/View/Layout.php:606]
#76 Magento\Framework\View\Layout->_renderContainer() called at [vendor/magento/framework/View/Layout.php:557]
#77 Magento\Framework\View\Layout->renderNonCachedElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:149]
#78 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement() called at [vendor/magento/framework/View/Layout.php:510]
#79 Magento\Framework\View\Layout->renderElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:140]
#80 Magento\Framework\View\Layout\Interceptor->renderElement() called at [vendor/magento/framework/View/Layout.php:606]
#81 Magento\Framework\View\Layout->_renderContainer() called at [vendor/magento/framework/View/Layout.php:557]
#82 Magento\Framework\View\Layout->renderNonCachedElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:149]
#83 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement() called at [vendor/magento/framework/View/Layout.php:510]
#84 Magento\Framework\View\Layout->renderElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:140]
#85 Magento\Framework\View\Layout\Interceptor->renderElement() called at [vendor/magento/framework/View/Layout.php:606]
#86 Magento\Framework\View\Layout->_renderContainer() called at [vendor/magento/framework/View/Layout.php:557]
#87 Magento\Framework\View\Layout->renderNonCachedElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:149]
#88 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement() called at [vendor/magento/framework/View/Layout.php:510]
#89 Magento\Framework\View\Layout->renderElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:140]
#90 Magento\Framework\View\Layout\Interceptor->renderElement() called at [vendor/magento/framework/View/Layout.php:606]
#91 Magento\Framework\View\Layout->_renderContainer() called at [vendor/magento/framework/View/Layout.php:557]
#92 Magento\Framework\View\Layout->renderNonCachedElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:149]
#93 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement() called at [vendor/magento/framework/View/Layout.php:510]
#94 Magento\Framework\View\Layout->renderElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:140]
#95 Magento\Framework\View\Layout\Interceptor->renderElement() called at [vendor/magento/framework/View/Layout.php:975]
#96 Magento\Framework\View\Layout->getOutput() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#97 Magento\Framework\View\Layout\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#98 Magento\Framework\View\Layout\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#99 Magento\Framework\View\Layout\Interceptor->___callPlugins() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:347]
#100 Magento\Framework\View\Layout\Interceptor->getOutput() called at [vendor/magento/framework/View/Result/Page.php:258]
#101 Magento\Framework\View\Result\Page->render() called at [vendor/magento/framework/View/Result/Layout.php:171]
#102 Magento\Framework\View\Result\Layout->renderResult() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#103 Magento\Framework\View\Result\Page\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#104 Magento\Framework\View\Result\Page\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#105 Magento\Framework\View\Result\Page\Interceptor->___callPlugins() called at [generated/code/Magento/Framework/View/Result/Page/Interceptor.php:95]
#106 Magento\Framework\View\Result\Page\Interceptor->renderResult() called at [vendor/magento/framework/App/Http.php:120]
#107 Magento\Framework\App\Http->launch() called at [generated/code/Magento/Framework/App/Http/Interceptor.php:23]
#108 Magento\Framework\App\Http\Interceptor->launch() called at [vendor/magento/framework/App/Bootstrap.php:263]
#109 Magento\Framework\App\Bootstrap->run() called at [pub/index.php:29]
==============================================================
Related
I am building a Flutter application -using Navigator 2.0 with go_router- with nested navigation on the bottom navigation bar, and 3 sub-route on the Home route: Single Post, Single Category, and Single Tag.
When I tried to open a single post URL on the browser, the deep link worked, and it opened the Single Post page on the app. But then, when I clicked the page's back button or the android back-gesture, it has thrown a _CastError: Null check operator used on a null value, and the Home page is not displayed.
What's wrong here, and how can I solve this?
Here is the source code: https://github.com/KweeksNews/kweeksnews_app/tree/develop (branch develop)
Error is thrown on this line: https://github.com/KweeksNews/kweeksnews_app/blob/11747545ab09dfc829ce02094ad16f9735cc39be/lib/core/widgets/navbar.dart#L68
Here is the debug log:
════════ Exception caught by widgets library ═══════════════════════════════════
The following _CastError was thrown, building Builder:
Null check operator used on a null value
The relevant error-causing widget was
MaterialApp
When the exception was thrown, this was the stack
#0 ScrollPosition.viewportDimension
#1 _PagePosition.getPixelsFromPage
#2 PageController.jumpToPage
#3 _NavBarState.didUpdateWidget
#4 StatefulElement.update
#5 Element.updateChild
#6 SingleChildRenderObjectElement.update
#7 Element.updateChild
#8 ComponentElement.performRebuild
#9 Element.rebuild
#10 StatelessElement.update
#11 Element.updateChild
#12 SingleChildRenderObjectElement.update
#13 Element.updateChild
#14 SingleChildRenderObjectElement.update
#15 Element.updateChild
#16 ComponentElement.performRebuild
#17 StatefulElement.performRebuild
#18 Element.rebuild
#19 StatefulElement.update
#20 Element.updateChild
#21 SingleChildRenderObjectElement.update
#22 Element.updateChild
#23 SingleChildRenderObjectElement.update
#24 Element.updateChild
#25 ComponentElement.performRebuild
#26 StatefulElement.performRebuild
#27 Element.rebuild
#28 StatefulElement.update
#29 Element.updateChild
#30 ComponentElement.performRebuild
#31 Element.rebuild
#32 StatelessElement.update
#33 Element.updateChild
#34 ComponentElement.performRebuild
#35 StatefulElement.performRebuild
#36 Element.rebuild
#37 StatefulElement.update
#38 Element.updateChild
#39 SingleChildRenderObjectElement.update
#40 Element.updateChild
#41 SingleChildRenderObjectElement.update
#42 Element.updateChild
#43 ComponentElement.performRebuild
#44 Element.rebuild
#45 ProxyElement.update
#46 _InheritedNotifierElement.update
#47 Element.updateChild
#48 SingleChildRenderObjectElement.update
#49 Element.updateChild
#50 ComponentElement.performRebuild
#51 StatefulElement.performRebuild
#52 Element.rebuild
#53 StatefulElement.update
#54 Element.updateChild
#55 ComponentElement.performRebuild
#56 Element.rebuild
#57 ProxyElement.update
#58 Element.updateChild
#59 ComponentElement.performRebuild
#60 Element.rebuild
#61 ProxyElement.update
#62 Element.updateChild
#63 ComponentElement.performRebuild
#64 StatefulElement.performRebuild
#65 Element.rebuild
#66 StatefulElement.update
#67 Element.updateChild
#68 ComponentElement.performRebuild
#69 Element.rebuild
#70 StatelessElement.update
#71 Element.updateChild
#72 ComponentElement.performRebuild
#73 Element.rebuild
#74 StatelessElement.update
#75 Element.updateChild
#76 SingleChildRenderObjectElement.update
#77 Element.updateChild
#78 ComponentElement.performRebuild
#79 Element.rebuild
#80 ProxyElement.update
#81 Element.updateChild
#82 ComponentElement.performRebuild
#83 Element.rebuild
#84 ProxyElement.update
#85 Element.updateChild
#86 ComponentElement.performRebuild
#87 StatefulElement.performRebuild
#88 Element.rebuild
#89 StatefulElement.update
#90 Element.updateChild
#91 ComponentElement.performRebuild
#92 StatefulElement.performRebuild
#93 Element.rebuild
#94 StatefulElement.update
#95 Element.updateChild
#96 ComponentElement.performRebuild
#97 StatefulElement.performRebuild
#98 Element.rebuild
#99 BuildOwner.buildScope
#100 WidgetsBinding.drawFrame
#101 RendererBinding._handlePersistentFrameCallback
#102 SchedulerBinding._invokeFrameCallback
#103 SchedulerBinding.handleDrawFrame
#104 SchedulerBinding._handleDrawFrame
#108 _invoke (dart:ui/hooks.dart:151:10)
#109 PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:308:5)
#110 _drawFrame (dart:ui/hooks.dart:115:31)
I'm not pretty sure about the real cause, but this is what I think happened.
So when the app opened using deep link into SingePost page, the app puts a page containing Navbar widget first into the page stack, and then puts the SinglePost page on top of it. Here it should be noted that the Navbar is not yet rendered by the app.
The Navbar widget's body is a PageView containing 4 page: Home, Search, SavedPosts, and Settings. All four pages are implementing AutomaticKeepAliveClientMixin to save and keep the scroll position, so that when user is navigating to the other pages and return, the scroll position is persist.
When user is popping out from the SinglePost page, the app then will render the Navbar with Home as the PageView's selected child (because the Navbar is given with index parameter of 0). Now the interesting and confusing part is, the didUpdateWidget is also called when the Navbar is being rendered by the app after user popping out from SinglePost page, even no parameter is changed (the index still 0). This will trigger a _pageController.jumpToPage() function, which, I think, in turn will try to render the requested page with the last saved scroll position. But because the page has never been rendered before, the scroll position is Null.
To fix this, now I put a check to make sure the new index is different with the current index before calling the _pageController.jumpToPage() function, and it worked.
Any one help me to fix this issue...?
1 exception(s):
Exception #0 (Zend_Acl_Role_Registry_Exception): Role '174' not found
Exception #0 (Zend_Acl_Role_Registry_Exception): Role '174' not found
#1 Zend_Acl->isAllowed(174, 'Bss_FacebookPixe...') called at [vendor/magento/module-authorization/Model/Acl/AclRetriever.php:120]
#2 Magento\Authorization\Model\Acl\AclRetriever->getAllowedResourcesByRole(174) called at [vendor/magento/module-user/Block/Role/Tab/Edit.php:191]
#3 Magento\User\Block\Role\Tab\Edit->getSelectedResources() called at [vendor/magento/module-user/Block/Role/Tab/Edit.php:167]
#4 Magento\User\Block\Role\Tab\Edit->isEverythingAllowed() called at [vendor/magento/module-user/view/adminhtml/templates/role/edit.phtml:27]
#5 include('/mnt/singvoldill...') called at [vendor/magento/framework/View/TemplateEngine/Php.php:59]
#6 Magento\Framework\View\TemplateEngine\Php->render(&Magento\User\Block\Role\Tab\Edit#000000004d4ff5730000000004125d27#, '/mnt/singvoldill...', array()) called at [vendor/magento/framework/View/Element/Template.php:271]
#7 Magento\Framework\View\Element\Template->fetchView('/mnt/singvoldill...') called at [vendor/magento/framework/View/Element/Template.php:301]
#8 Magento\Framework\View\Element\Template->_toHtml() called at [vendor/magento/module-backend/Block/Template.php:129]
#9 Magento\Backend\Block\Template->_toHtml() called at [vendor/magento/framework/View/Element/AbstractBlock.php:668]
#10 Magento\Framework\View\Element\AbstractBlock->toHtml() called at [vendor/magento/module-backend/Block/Widget/Tabs.php:492]
#11 Magento\Backend\Block\Widget\Tabs->getTabContent(&Magento\User\Block\Role\Tab\Edit#000000004d4ff5730000000004125d27#) called at [vendor/magento/module-backend/view/adminhtml/templates/widget/tabs.phtml:57]
#12 include('/mnt/singvoldill...') called at [vendor/magento/framework/View/TemplateEngine/Php.php:59]
#13 Magento\Framework\View\TemplateEngine\Php->render(&Magento\User\Block\Role\Edit#000000004d4ff5770000000004125d27#, '/mnt/singvoldill...', array('tabs' => array('info' => &Magento\User\Block\Role\Tab\Info#000000004d4ff5480000000004125d27#, 'account' => &Magento\User\Block\Role\Tab\Edit#000000004d4ff5730000000004125d27#, 'roles' => &Magento\Framework\DataObject#000000004d4ff2f70000000004125d27#))) called at [vendor/magento/framework/View/Element/Template.php:271]
#14 Magento\Framework\View\Element\Template->fetchView('/mnt/singvoldill...') called at [vendor/magento/framework/View/Element/Template.php:301]
#15 Magento\Framework\View\Element\Template->_toHtml() called at [vendor/magento/module-backend/Block/Template.php:129]
#16 Magento\Backend\Block\Template->_toHtml() called at [vendor/magento/framework/View/Element/AbstractBlock.php:668]
#17 Magento\Framework\View\Element\AbstractBlock->toHtml() called at [vendor/magento/framework/View/Layout.php:557]
#18 Magento\Framework\View\Layout->_renderBlock('adminhtml.user.e...') called at [vendor/magento/framework/View/Layout.php:533]
#19 Magento\Framework\View\Layout->renderNonCachedElement('adminhtml.user.e...') called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:206]
#20 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('adminhtml.user.e...') called at [vendor/magento/framework/View/Layout.php:488]
#21 Magento\Framework\View\Layout->renderElement('adminhtml.user.e...', false) called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:193]
#22 Magento\Framework\View\Layout\Interceptor->renderElement('adminhtml.user.e...', false) called at [vendor/magento/framework/View/Layout.php:585]
#23 Magento\Framework\View\Layout->_renderContainer('left', false) called at [vendor/magento/framework/View/Layout.php:535]
#24 Magento\Framework\View\Layout->renderNonCachedElement('left') called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:206]
#25 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('left') called at [vendor/magento/framework/View/Layout.php:488]
#26 Magento\Framework\View\Layout->renderElement('left', false) called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:193]
#27 Magento\Framework\View\Layout\Interceptor->renderElement('left', false) called at [vendor/magento/framework/View/Layout.php:585]
#28 Magento\Framework\View\Layout->_renderContainer('side.col', false) called at [vendor/magento/framework/View/Layout.php:535]
#29 Magento\Framework\View\Layout->renderNonCachedElement('side.col') called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:206]
#30 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('side.col') called at [vendor/magento/framework/View/Layout.php:488]
#31 Magento\Framework\View\Layout->renderElement('side.col', false) called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:193]
#32 Magento\Framework\View\Layout\Interceptor->renderElement('side.col', false) called at [vendor/magento/framework/View/Layout.php:585]
#33 Magento\Framework\View\Layout->_renderContainer('page.main.contai...', false) called at [vendor/magento/framework/View/Layout.php:535]
#34 Magento\Framework\View\Layout->renderNonCachedElement('page.main.contai...') called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:206]
#35 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('page.main.contai...') called at [vendor/magento/framework/View/Layout.php:488]
#36 Magento\Framework\View\Layout->renderElement('page.main.contai...', false) called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:193]
#37 Magento\Framework\View\Layout\Interceptor->renderElement('page.main.contai...', false) called at [vendor/magento/framework/View/Layout.php:585]
#38 Magento\Framework\View\Layout->_renderContainer('page.content', false) called at [vendor/magento/framework/View/Layout.php:535]
#39 Magento\Framework\View\Layout->renderNonCachedElement('page.content') called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:206]
#40 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('page.content') called at [vendor/magento/framework/View/Layout.php:488]
#41 Magento\Framework\View\Layout->renderElement('page.content', false) called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:193]
#42 Magento\Framework\View\Layout\Interceptor->renderElement('page.content', false) called at [vendor/magento/framework/View/Layout.php:585]
#43 Magento\Framework\View\Layout->_renderContainer('page.wrapper', false) called at [vendor/magento/framework/View/Layout.php:535]
#44 Magento\Framework\View\Layout->renderNonCachedElement('page.wrapper') called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:206]
#45 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('page.wrapper') called at [vendor/magento/framework/View/Layout.php:488]
#46 Magento\Framework\View\Layout->renderElement('page.wrapper', false) called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:193]
#47 Magento\Framework\View\Layout\Interceptor->renderElement('page.wrapper', false) called at [vendor/magento/framework/View/Layout.php:585]
#48 Magento\Framework\View\Layout->_renderContainer('backend.page', false) called at [vendor/magento/framework/View/Layout.php:535]
#49 Magento\Framework\View\Layout->renderNonCachedElement('backend.page') called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:206]
#50 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('backend.page') called at [vendor/magento/framework/View/Layout.php:488]
#51 Magento\Framework\View\Layout->renderElement('backend.page', false) called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:193]
#52 Magento\Framework\View\Layout\Interceptor->renderElement('backend.page', false) called at [vendor/magento/framework/View/Layout.php:585]
#53 Magento\Framework\View\Layout->_renderContainer('root', false) called at [vendor/magento/framework/View/Layout.php:535]
#54 Magento\Framework\View\Layout->renderNonCachedElement('root') called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:206]
#55 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('root') called at [vendor/magento/framework/View/Layout.php:488]
#56 Magento\Framework\View\Layout->renderElement('root', true) called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:193]
#57 Magento\Framework\View\Layout\Interceptor->renderElement('root') called at [vendor/magento/framework/View/Layout.php:954]
#58 Magento\Framework\View\Layout->getOutput() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:492]
#59 Magento\Framework\View\Layout\Interceptor->getOutput() called at [vendor/magento/framework/View/Result/Page.php:258]
#60 Magento\Framework\View\Result\Page->render(&Magento\Framework\App\Response\Http\Interceptor#000000004d4fdeb20000000004125d27#) called at [vendor/magento/framework/View/Result/Layout.php:171]
#61 Magento\Framework\View\Result\Layout->renderResult(&Magento\Framework\App\Response\Http\Interceptor#000000004d4fdeb20000000004125d27#) called at [generated/code/Magento/Backend/Model/View/Result/Page/Interceptor.php:193]
#62 Magento\Backend\Model\View\Result\Page\Interceptor->renderResult(&Magento\Framework\App\Response\Http\Interceptor#000000004d4fdeb20000000004125d27#) called at [vendor/magento/framework/App/View.php:221]
#63 Magento\Framework\App\View->renderLayout() called at [vendor/magento/module-user/Controller/Adminhtml/User/Role/EditRole.php:52]
#64 Magento\User\Controller\Adminhtml\User\Role\EditRole->execute() called at [generated/code/Magento/User/Controller/Adminhtml/User/Role/EditRole/Interceptor.php:24]
#65 Magento\User\Controller\Adminhtml\User\Role\EditRole\Interceptor->execute() called at [vendor/magento/framework/App/Action/Action.php:108]
#66 Magento\Framework\App\Action\Action->dispatch(&Magento\Framework\App\Request\Http#000000004d4fdef20000000004125d27#) called at [vendor/magento/module-backend/App/AbstractAction.php:231]
#67 Magento\Backend\App\AbstractAction->dispatch(&Magento\Framework\App\Request\Http#000000004d4fdef20000000004125d27#) called at [vendor/magento/framework/Interception/Interceptor.php:58]
#68 Magento\User\Controller\Adminhtml\User\Role\EditRole\Interceptor->___callParent('dispatch', array(&Magento\Framework\App\Request\Http#000000004d4fdef20000000004125d27#)) called at [vendor/magento/framework/Interception/Interceptor.php:138]
#69 Magento\User\Controller\Adminhtml\User\Role\EditRole\Interceptor->Magento\Framework\Interception\{closure}(&Magento\Framework\App\Request\Http#000000004d4fdef20000000004125d27#) called at [vendor/magento/module-backend/App/Action/Plugin/Authentication.php:143]
#70 Magento\Backend\App\Action\Plugin\Authentication->aroundDispatch(&Magento\User\Controller\Adminhtml\User\Role\EditRole\Interceptor#000000004d4fdd850000000004125d27#, &Closure#000000004d4fdd870000000004125d27#, &Magento\Framework\App\Request\Http#000000004d4fdef20000000004125d27#) called at [vendor/magento/framework/Interception/Interceptor.php:135]
#71 Magento\User\Controller\Adminhtml\User\Role\EditRole\Interceptor->Magento\Framework\Interception\{closure}(&Magento\Framework\App\Request\Http#000000004d4fdef20000000004125d27#) called at [vendor/magento/framework/Interception/Interceptor.php:153]
#72 Magento\User\Controller\Adminhtml\User\Role\EditRole\Interceptor->___callPlugins('dispatch', array(&Magento\Framework\App\Request\Http#000000004d4fdef20000000004125d27#), NULL) called at [generated/code/Magento/User/Controller/Adminhtml/User/Role/EditRole/Interceptor.php:39]
#73 Magento\User\Controller\Adminhtml\User\Role\EditRole\Interceptor->dispatch(&Magento\Framework\App\Request\Http#000000004d4fdef20000000004125d27#) called at [vendor/magento/framework/App/FrontController.php:159]
#74 Magento\Framework\App\FrontController->processRequest(&Magento\Framework\App\Request\Http#000000004d4fdef20000000004125d27#, &Magento\User\Controller\Adminhtml\User\Role\EditRole\Interceptor#000000004d4fdd850000000004125d27#) called at [vendor/magento/framework/App/FrontController.php:99]
#75 Magento\Framework\App\FrontController->dispatch(&Magento\Framework\App\Request\Http#000000004d4fdef20000000004125d27#) called at [vendor/magento/framework/Interception/Interceptor.php:58]
#76 Magento\Framework\App\FrontController\Interceptor->___callParent('dispatch', array(&Magento\Framework\App\Request\Http#000000004d4fdef20000000004125d27#)) called at [vendor/magento/framework/Interception/Interceptor.php:138]
#77 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(&Magento\Framework\App\Request\Http#000000004d4fdef20000000004125d27#) called at [vendor/magento/framework/Interception/Interceptor.php:153]
#78 Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', array(&Magento\Framework\App\Request\Http#000000004d4fdef20000000004125d27#), array(array('default_store_se...', 'page_cache_from_...', 'storeCookieValid...', 'install', 'configHash'))) called at [generated/code/Magento/Framework/App/FrontController/Interceptor.php:26]
#79 Magento\Framework\App\FrontController\Interceptor->dispatch(&Magento\Framework\App\Request\Http#000000004d4fdef20000000004125d27#) called at [vendor/magento/framework/App/Http.php:136]
#80 Magento\Framework\App\Http->launch() called at [generated/code/Magento/Framework/App/Http/Interceptor.php:24]
#81 Magento\Framework\App\Http\Interceptor->launch() called at [vendor/magento/framework/App/Bootstrap.php:258]
#82 Magento\Framework\App\Bootstrap->run(&Magento\Framework\App\Http\Interceptor#000000004d4fdebc0000000004125d27#) called at [index.php:76]
It looks like issue is related to extension "Bss_FacebookPixel".
To test you can disable that extension and try again or you can select or deselect role related to this extension.
Integrated Graphql graphql_flutter by following this documentation. Everything works fine on development mode for both Android and iOS but when i try to deploy Android in release mode, i'm able to generate APK. Once i run on the phone i see this error on Logcat
2020-03-03 12:15:09.822 7384-7408/? E/flutter: [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: NoSuchMethodError: The getter 'host' was called on null.
Receiver: null
Tried calling: host
#0 translateNetworkFailure (package:graphql/src/exceptions/io_network_exception.dart:14)
#1 translateFailure (package:graphql/src/exceptions/exceptions.dart:13)
#2 new HttpLink.<anonymous closure>.onListen (package:graphql/src/link/http/link_http.dart:104)
<asynchronous suspension>
#3 _runGuarded (dart:async/stream_controller.dart:807)
#4 _StreamController._subscribe.<anonymous closure> (dart:async/stream_controller.dart:686)
#5 _BufferingStreamSubscription._guardCallback (dart:async/stream_impl.dart:416)
#6 _StreamController._subscribe (dart:async/stream_controller.dart:685)
#7 _ControllerStream._createSubscription (dart:async/stream_controller.dart:820)
#8 _StreamImpl.listen (dart:async/stream_impl.dart:474)
#9 Stream.first (dart:async/stream.dart:1251)
#10 QueryManager._resolveQueryOnNetwork (package:graphql/src/core/query_manager.dart:119)
#11 QueryManager.fetchQueryAsMultiSourceResult (package:graphql/src/core/query_manager.dart:97)
#12 ObservableQuery.fetchResults (package:graphql/src/core/observable_query.dart:123)
#13 new ObservableQuery (package:graphql/src/core/observable_query.dart:32)
#14 QueryManager.watchQuery (package:graphql/src/core/query_manager.dart:35)
#15 GraphQLClient.watchQuery (package:graphql/src/graphql_client.dart:99)
#16 QueryState._initQuery (package:graphql_flutter/src/widgets/query.dart:60)
#17 QueryState.didChangeDependencies (package:graphql_flutter/src/widgets/query.dart:66)
#18 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4376)
#19 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4201)
#20 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194)
#21 Element.updateChild (package:flutter/src/widgets/framework.dart:2988)
#22 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4243)
#23 Element.rebuild (package:flutter/src/widgets/framework.dart:3947)
#24 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4206)
#25 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4201)
#26 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194)
#27 Element.updateChild (package:flutter/src/widgets/framework.dart:2988)
#28 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4243)
#29 Element.rebuild (package:flutter/src/widgets/framework.dart:3947)
#30 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4206)
#31 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4201)
#32 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194)
#33 Element.updateChild (package:flutter/src/widgets/framework.dart:2988)
#34 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4243)
#35 Element.rebuild (package:flutter/src/widgets/framework.dart:3947)
#36 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4206)
#37 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4201)
#38 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194)
#39 Element.updateChild (package:flutter/src/widgets/framework.dart:2988)
#40 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4243)
#41 Element.rebuild (package:flutter/src/widgets/framework.dart:3947)
#42 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4206)
#43 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4201)
#44 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194)
#45 Element.updateChild (package:flutter/src/widgets/framework.dart:2988)
#46 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4243)
#47 Ele
Figured it out. Its because of permission issue. By default when an Android app runs on development it will have INTERNET permission.
Once you do a release the INTERNET permission will not be available anymore. You can check the official documentation here
Solution:
Open android manifest
./android/app/src/main/AndroidManifest.xml
Add internet permission to your manifest
<manifest xlmns:android...>
...
<uses-permission android:name="android.permission.INTERNET" />
<application ...
</manifest>
How can I resolve the problem as below ?
I run my application normally, it's run well.
But when I've set break point, then tried to perform debugging my code.
It always shows the error messages which do not come from my code, debugger is interrupted as well.
Unhandled exception:
NoSuchMethodError: The getter 'cls' was called on null.
Receiver: null
Tried calling: cls
#0 Object.noSuchMethod (dart:core-patch/object_patch.dart:50:5)
#1 BodyBuilder.lookupInstanceMember (package:front_end/src/fasta/kernel/body_builder.dart:1604:30)
#2 BodyBuilder.scopeLookup (package:front_end/src/fasta/kernel/body_builder.dart:1764:13)
#3 BodyBuilder.handleIdentifier (package:front_end/src/fasta/kernel/body_builder.dart:1700:12)
#4 Parser.ensureIdentifier (package:front_end/src/fasta/parser/parser.dart:2165:14)
#5 Parser.parseSend (package:front_end/src/fasta/parser/parser.dart:4932:32)
#6 Parser.parseSendOrFunctionLiteral (package:front_end/src/fasta/parser/parser.dart:4675:12)
#7 Parser.parsePrimary (package:front_end/src/fasta/parser/parser.dart:4233:14)
#8 Parser.parseUnaryExpression (package:front_end/src/fasta/parser/parser.dart:4172:12)
#9 Parser.parsePrecedenceExpression (package:front_end/src/fasta/parser/parser.dart:3961:13)
#10 Parser.parseExpression (package:front_end/src/fasta/parser/parser.dart:3933:13)
#11 BodyBuilder.parseSingleExpression (package:front_end/src/fasta/kernel/body_builder.dart:1111:20)
#12 SourceLoader.buildExpression (package:front_end/src/fasta/source/source_loader.dart:327:21)
#13 IncrementalCompiler.compileExpression. (package:front_end/src/fasta/incremental_compiler.dart:795:61)
#14 CompilerContext.runInContext..
(package:front_end/src/fasta/compiler_context.dart:122:46)
#15 new Future.sync (dart:async/future.dart:224:31)
#16 CompilerContext.runInContext. (package:front_end/src/fasta/compiler_context.dart:122:19)
#17 _rootRun (dart:async/zone.dart:1124:13)
#18 _CustomZone.run (dart:async/zone.dart:1021:19)
#19 _runZoned (dart:async/zone.dart:1516:10)
#20 runZoned (dart:async/zone.dart:1463:12)
#21 CompilerContext.runInContext (package:front_end/src/fasta/compiler_context.dart:121:12)
#22 IncrementalCompiler.compileExpression (package:front_end/src/fasta/incremental_compiler.dart:726:26)
#23 IncrementalCompiler.compileExpression (package:vm/incremental_compiler.dart:156:23)
#24 FrontendCompiler.compileExpression (package:vm/frontend_server.dart:527:44)
#25 _FlutterFrontendCompiler.compileExpression (package:frontend_server/server.dart:62:22)
#26 listenAndCompile. (package:vm/frontend_server.dart:812:20)
#27 _RootZone.runUnaryGuarded (dart:async/zone.dart:1314:10)
#28 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
#29 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
#30 _SinkTransformerStreamSubscription._add (dart:async/stream_transformers.dart:68:11)
#31 _EventSinkWrapper.add (dart:async/stream_transformers.dart:15:11)
#32 _StringAdapterSink.add (dart:convert/string_conversion.dart:236:11)
#33 _LineSplitterSink._addLines (dart:convert/line_splitter.dart:150:13)
#34 _LineSplitterSink.addSlice (dart:convert/line_splitter.dart:125:5)
#35 StringConversionSinkMixin.add (dart:convert/string_conversion.dart:163:5)
#36 _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:120:24)
#37 _RootZone.runUnaryGuarded (dart:async/zone.dart:1314:10)
#38 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
#39 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
#40 _SinkTransformerStreamSubscription._add (dart:async/stream_transformers.dart:68:11)
#41 _EventSinkWrapper.add (dart:async/stream_transformers.dart:15:11)
#42 _StringAdapterSink.add (dart:convert/string_conversion.dart:236:11)
#43 _StringAdapterSink.addSlice (dart:convert/string_conversion.dart:241:7)
#44 _Utf8ConversionSink.addSlice (dart:convert/string_conversion.dart:312:20)
#45 _Utf8ConversionSink.add (dart:convert/string_conversion.dart:305:5)
#46 _ConverterStreamEventSink.add (dart:convert/chunked_conversion.dart:72:18)
#47 _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:120:24)
#48 _RootZone.runUnaryGuarded (dart:async/zone.dart:1314:10)
#49 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
#50 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
#51 _SyncStreamController._sendData (dart:async/stream_controller.dart:764:19)
#52 _StreamController._add (dart:async/stream_controller.dart:640:7)
#53 _StreamController.add (dart:async/stream_controller.dart:586:5)
#54 _Socket._onData (dart:io-patch/socket_patch.dart:1786:41)
#55 _RootZone.runUnaryGuarded (dart:async/zone.dart:1314:10)
#56 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
#57 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
#58 _SyncStreamController._sendData (dart:async/stream_controller.dart:764:19)
#59 _StreamController._add (dart:async/stream_controller.dart:640:7)
#60 _StreamController.add (dart:async/stream_controller.dart:586:5)
#61 new _RawSocket. (dart:io-patch/socket_patch.dart:1335:33)
#62 _NativeSocket.issueReadEvent.issue (dart:io-patch/socket_patch.dart:856:14)
#63 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#64 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#65 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:116:13)
#66 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:173:5)
My code:
main.dart
void main() async {
Flame.images.loadAll(<String>[
'level0.jpg'
]);
Util flameUtil = Util();
await flameUtil.fullScreen();
await flameUtil.setOrientation(DeviceOrientation.portraitUp);
MyGame game = MyGame ();
runApp(game.widget);
....
mygame.dart:
......
MyGame() {
sprite = Sprite('level0.jpg');// Break point
}
.............
note:
I am using Android studio 3.1
flutter veriosn 1.7.8
channel stable
Thanks a lot!!!
I have installed the Magento 2.1.0.
And I try to update the stock status before opening each product page in program.
The code what I used to update the stock:
// has $sku and quantity of product now
$stockItem = $this->_stockRegistry->getStockItemBySku($sku);
if($quantity > 0){
$stockItem->setQty($quantity);
$stockItem->setIsInStock(true);
}else{
$stockItem->setQty(0);
$stockItem->setIsInStock(false);
}
$this->_stockRegistry->updateStockItemBySku($sku, $stockItem);
Suddenly I can't open the product page because of the exceptions as follow:
I don't know whether because of the update of the product stock.
1 exception(s):
Exception #0 (Exception): Warning: Illegal offset type in isset or empty in D:\www_wamp_3.0.6\YingStyle\vendor\magento\module-eav\Model\Entity\Attribute\Source\AbstractSource.php on line 74
Exception #0 (Exception): Warning: Illegal offset type in isset or empty in D:\www_wamp_3.0.6\YingStyle\vendor\magento\module-eav\Model\Entity\Attribute\Source\AbstractSource.php on line 74
#0 D:\www_wamp_3.0.6\YingStyle\vendor\magento\module-eav\Model\Entity\Attribute\Source\AbstractSource.php(74): Magento\Framework\App\ErrorHandler->handler(2, 'Illegal offset ...', 'D:\\www_wamp_3.0...', 74, Array)
#1 D:\www_wamp_3.0.6\YingStyle\vendor\magento\module-eav\Model\Entity\Attribute\Frontend\AbstractFrontend.php(232): Magento\Eav\Model\Entity\Attribute\Source\AbstractSource->getOptionText(Array)
#2 D:\www_wamp_3.0.6\YingStyle\vendor\magento\module-eav\Model\Entity\Attribute\Frontend\AbstractFrontend.php(107): Magento\Eav\Model\Entity\Attribute\Frontend\AbstractFrontend->getOption(Array)
#3 D:\www_wamp_3.0.6\YingStyle\vendor\magento\module-catalog\Block\Product\View\Attributes.php(79): Magento\Eav\Model\Entity\Attribute\Frontend\AbstractFrontend->getValue(Object(Magento\Catalog\Model\Product\Interceptor))
#4 D:\www_wamp_3.0.6\YingStyle\vendor\magento\module-catalog\view\frontend\templates\product\view\attributes.phtml(19): Magento\Catalog\Block\Product\View\Attributes->getAdditionalData()
#5 D:\www_wamp_3.0.6\YingStyle\vendor\magento\framework\View\TemplateEngine\Php.php(59): include('D:\\www_wamp_3.0...')
#6 D:\www_wamp_3.0.6\YingStyle\vendor\magento\framework\View\Element\Template.php(255): Magento\Framework\View\TemplateEngine\Php->render(Object(Magento\Catalog\Block\Product\View\Attributes), 'D:/www_wamp_3.0...', Array)
#7 D:\www_wamp_3.0.6\YingStyle\vendor\magento\framework\View\Element\Template.php(279): Magento\Framework\View\Element\Template->fetchView('D:/www_wamp_3.0...')
#8 D:\www_wamp_3.0.6\YingStyle\vendor\magento\framework\View\Element\AbstractBlock.php(659): Magento\Framework\View\Element\Template->_toHtml()
#9 D:\www_wamp_3.0.6\YingStyle\vendor\magento\framework\View\Layout.php(542): Magento\Framework\View\Element\AbstractBlock->toHtml()
#10 D:\www_wamp_3.0.6\YingStyle\vendor\magento\framework\View\Layout.php(518): Magento\Framework\View\Layout->_renderBlock('product.attribu...')
#11 D:\www_wamp_3.0.6\YingStyle\var\generation\Magento\Framework\View\Layout\Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('product.attribu...')
#12 D:\www_wamp_3.0.6\YingStyle\vendor\magento\framework\View\Layout.php(472): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('product.attribu...')
#13 D:\www_wamp_3.0.6\YingStyle\var\generation\Magento\Framework\View\Layout\Interceptor.php(193): Magento\Framework\View\Layout->renderElement('product.attribu...', true)
#14 D:\www_wamp_3.0.6\YingStyle\app\design\frontend\Smartwave\porto\Magento_Catalog\templates\product\view\details.phtml(24): Magento\Framework\View\Layout\Interceptor->renderElement('product.attribu...')
#15 D:\www_wamp_3.0.6\YingStyle\vendor\magento\framework\View\TemplateEngine\Php.php(59): include('D:\\www_wamp_3.0...')
#16 D:\www_wamp_3.0.6\YingStyle\vendor\magento\framework\View\Element\Template.php(255): Magento\Framework\View\TemplateEngine\Php->render(Object(Magento\Catalog\Block\Product\View\Description), 'D:/www_wamp_3.0...', Array)
#17 D:\www_wamp_3.0.6\YingStyle\vendor\magento\framework\View\Element\Template.php(279): Magento\Framework\View\Element\Template->fetchView('D:/www_wamp_3.0...')
#18 D:\www_wamp_3.0.6\YingStyle\vendor\magento\framework\View\Element\AbstractBlock.php(659): Magento\Framework\View\Element\Template->_toHtml()
#19 D:\www_wamp_3.0.6\YingStyle\vendor\magento\framework\View\Layout.php(542): Magento\Framework\View\Element\AbstractBlock->toHtml()
#20 D:\www_wamp_3.0.6\YingStyle\vendor\magento\framework\View\Layout.php(518): Magento\Framework\View\Layout->_renderBlock('product.info.de...')
#21 D:\www_wamp_3.0.6\YingStyle\var\generation\Magento\Framework\View\Layout\Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('product.info.de...')
#22 D:\www_wamp_3.0.6\YingStyle\vendor\magento\framework\View\Layout.php(472): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('product.info.de...')
#23 D:\www_wamp_3.0.6\YingStyle\var\generation\Magento\Framework\View\Layout\Interceptor.php(193): Magento\Framework\View\Layout->renderElement('product.info.de...', true)
#24 D:\www_wamp_3.0.6\YingStyle\vendor\magento\framework\View\Layout.php(569): Magento\Framework\View\Layout\Interceptor->renderElement('product.info.de...')
#25 D:\www_wamp_3.0.6\YingStyle\vendor\magento\framework\View\Layout.php(520): Magento\Framework\View\Layout->_renderContainer('content')
#26 D:\www_wamp_3.0.6\YingStyle\var\generation\Magento\Framework\View\Layout\Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('content')
#27 D:\www_wamp_3.0.6\YingStyle\vendor\magento\framework\View\Layout.php(472): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('content')
#28 D:\www_wamp_3.0.6\YingStyle\var\generation\Magento\Framework\View\Layout\Interceptor.php(193): Magento\Framework\View\Layout->renderElement('content', true)
#29 D:\www_wamp_3.0.6\YingStyle\vendor\magento\framework\View\Layout.php(569): Magento\Framework\View\Layout\Interceptor->renderElement('content')
#30 D:\www_wamp_3.0.6\YingStyle\vendor\magento\framework\View\Layout.php(520): Magento\Framework\View\Layout->_renderContainer('main')
#31 D:\www_wamp_3.0.6\YingStyle\var\generation\Magento\Framework\View\Layout\Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('main')
#32 D:\www_wamp_3.0.6\YingStyle\vendor\magento\framework\View\Layout.php(472): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('main')
#33 D:\www_wamp_3.0.6\YingStyle\var\generation\Magento\Framework\View\Layout\Interceptor.php(193): Magento\Framework\View\Layout->renderElement('main', true)
#34 D:\www_wamp_3.0.6\YingStyle\vendor\magento\framework\View\Layout.php(569): Magento\Framework\View\Layout\Interceptor->renderElement('main')
#35 D:\www_wamp_3.0.6\YingStyle\vendor\magento\framework\View\Layout.php(520): Magento\Framework\View\Layout->_renderContainer('columns')
#36 D:\www_wamp_3.0.6\YingStyle\var\generation\Magento\Framework\View\Layout\Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('columns')
#37 D:\www_wamp_3.0.6\YingStyle\vendor\magento\framework\View\Layout.php(472): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('columns')
#38 D:\www_wamp_3.0.6\YingStyle\var\generation\Magento\Framework\View\Layout\Interceptor.php(193): Magento\Framework\View\Layout->renderElement('columns', true)
#39 D:\www_wamp_3.0.6\YingStyle\vendor\magento\framework\View\Layout.php(569): Magento\Framework\View\Layout\Interceptor->renderElement('columns')
#40 D:\www_wamp_3.0.6\YingStyle\vendor\magento\framework\View\Layout.php(520): Magento\Framework\View\Layout->_renderContainer('main.content')
#41 D:\www_wamp_3.0.6\YingStyle\var\generation\Magento\Framework\View\Layout\Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('main.content')
#42 D:\www_wamp_3.0.6\YingStyle\vendor\magento\framework\View\Layout.php(472): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('main.content')
#43 D:\www_wamp_3.0.6\YingStyle\var\generation\Magento\Framework\View\Layout\Interceptor.php(193): Magento\Framework\View\Layout->renderElement('main.content', true)
#44 D:\www_wamp_3.0.6\YingStyle\vendor\magento\framework\View\Layout.php(569): Magento\Framework\View\Layout\Interceptor->renderElement('main.content')
#45 D:\www_wamp_3.0.6\YingStyle\vendor\magento\framework\View\Layout.php(520): Magento\Framework\View\Layout->_renderContainer('page.wrapper')
#46 D:\www_wamp_3.0.6\YingStyle\var\generation\Magento\Framework\View\Layout\Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('page.wrapper')
#47 D:\www_wamp_3.0.6\YingStyle\vendor\magento\framework\View\Layout.php(472): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('page.wrapper')
#48 D:\www_wamp_3.0.6\YingStyle\var\generation\Magento\Framework\View\Layout\Interceptor.php(193): Magento\Framework\View\Layout->renderElement('page.wrapper', true)
#49 D:\www_wamp_3.0.6\YingStyle\vendor\magento\framework\View\Layout.php(569): Magento\Framework\View\Layout\Interceptor->renderElement('page.wrapper')
#50 D:\www_wamp_3.0.6\YingStyle\vendor\magento\framework\View\Layout.php(520): Magento\Framework\View\Layout->_renderContainer('root')
#51 D:\www_wamp_3.0.6\YingStyle\var\generation\Magento\Framework\View\Layout\Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('root')
#52 D:\www_wamp_3.0.6\YingStyle\vendor\magento\framework\View\Layout.php(472): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('root')
#53 D:\www_wamp_3.0.6\YingStyle\var\generation\Magento\Framework\View\Layout\Interceptor.php(193): Magento\Framework\View\Layout->renderElement('root', true)
#54 D:\www_wamp_3.0.6\YingStyle\vendor\magento\framework\View\Layout.php(938): Magento\Framework\View\Layout\Interceptor->renderElement('root')
#55 D:\www_wamp_3.0.6\YingStyle\vendor\magento\framework\Interception\Interceptor.php(146): Magento\Framework\View\Layout->getOutput()
#56 D:\www_wamp_3.0.6\YingStyle\var\generation\Magento\Framework\View\Layout\Interceptor.php(494): Magento\Framework\View\Layout\Interceptor->___callPlugins('getOutput', Array, Array)
#57 D:\www_wamp_3.0.6\YingStyle\vendor\magento\framework\View\Result\Page.php(243): Magento\Framework\View\Layout\Interceptor->getOutput()
#58 D:\www_wamp_3.0.6\YingStyle\vendor\magento\framework\View\Result\Layout.php(164): Magento\Framework\View\Result\Page->render(Object(Magento\Framework\App\Response\Http\Interceptor))
#59 D:\www_wamp_3.0.6\YingStyle\vendor\magento\framework\Interception\Interceptor.php(74): Magento\Framework\View\Result\Layout->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))
#60 D:\www_wamp_3.0.6\YingStyle\vendor\magento\framework\Interception\Chain\Chain.php(70): Magento\Framework\View\Result\Page\Interceptor->___callParent('renderResult', Array)
#61 D:\www_wamp_3.0.6\YingStyle\vendor\magento\framework\Interception\Chain\Chain.php(63): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Framewo...', 'renderResult', Object(Magento\Framework\View\Result\Page\Interceptor), Array, 'result-varnish-...')
#62 D:\www_wamp_3.0.6\YingStyle\vendor\magento\module-page-cache\Model\Controller\Result\VarnishPlugin.php(74): Magento\Framework\Interception\Chain\Chain->Magento\Framework\Interception\Chain\{closure}(Object(Magento\Framework\App\Response\Http\Interceptor))
#63 D:\www_wamp_3.0.6\YingStyle\vendor\magento\framework\Interception\Chain\Chain.php(67): Magento\PageCache\Model\Controller\Result\VarnishPlugin->aroundRenderResult(Object(Magento\Framework\View\Result\Page\Interceptor), Object(Closure), Object(Magento\Framework\App\Response\Http\Interceptor))
#64 D:\www_wamp_3.0.6\YingStyle\vendor\magento\framework\Interception\Interceptor.php(138): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Framewo...', 'renderResult', Object(Magento\Framework\View\Result\Page\Interceptor), Array, 'result-builtin-...')
#65 D:\www_wamp_3.0.6\YingStyle\vendor\magento\module-page-cache\Model\Controller\Result\BuiltinPlugin.php(67): Magento\Framework\View\Result\Page\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Response\Http\Interceptor))
#66 D:\www_wamp_3.0.6\YingStyle\vendor\magento\framework\Interception\Interceptor.php(142): Magento\PageCache\Model\Controller\Result\BuiltinPlugin->aroundRenderResult(Object(Magento\Framework\View\Result\Page\Interceptor), Object(Closure), Object(Magento\Framework\App\Response\Http\Interceptor))
#67 D:\www_wamp_3.0.6\YingStyle\var\generation\Magento\Framework\View\Result\Page\Interceptor.php(130): Magento\Framework\View\Result\Page\Interceptor->___callPlugins('renderResult', Array, Array)
#68 D:\www_wamp_3.0.6\YingStyle\vendor\magento\framework\App\Http.php(139): Magento\Framework\View\Result\Page\Interceptor->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))
#69 D:\www_wamp_3.0.6\YingStyle\vendor\magento\framework\App\Bootstrap.php(258): Magento\Framework\App\Http->launch()
#70 D:\www_wamp_3.0.6\YingStyle\index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
#71 {main}
I don't know how to solve this problem.
So I found the file AbstractSource.php on line 74.
And I change the Code:
//if (isset($options[$value])) {
//return $options[$value];
//}
// new code here
if (isset($options['value'])) {
return $options['value'];
}
Now I can open the product again...
But I have two questions:
How to solve this problem/exception in a right way? I think I can't modify the file AbstractSource.php
Is there other problem, if I use the code "$option['value']"?
Thanks a lot!!!
The error you are getting is related to a select element in the product page not getting the correct option values or the values you have provided are not valid option values.
From your code it seems to be from how you are using setIsInStock. From the magento code block docs, that should be legal as the setIsInStock takes either bool or int. But from Magento Core code examples, they use int. Eg:
setIsInStock(1).
You can find an example here:
https://github.com/magento/magento2/blob/2.1.0/dev/tests/api-functional/testsuite/Magento/ConfigurableProduct/Api/CartItemRepositoryTest.php#L220
So I suggest you change the arguments from boolean to integer: 0 for false and 1 for true.
Let me know if that solves it.
Secondly, I am curious as to why you need to do this in the first place.