Smile-SA / magento2-module-seller

12 stars 23 forks source link

Invalid method Magento\Eav\Model\Entity\Attribute::isScopeGlobal #17

Open Chacalbis opened 4 years ago

Chacalbis commented 4 years ago

A while ago, we faced an error on product page view (front)

1 exception(s):
Exception #0 (Magento\Framework\Exception\LocalizedException): Méthode invalide Magento\Eav\Model\Entity\Attribute::isScopeGlobal

Exception #0 (Magento\Framework\Exception\LocalizedException): Méthode invalide Magento\Eav\Model\Entity\Attribute::isScopeGlobal
<pre>#1 Smile\Seller\Model\ResourceModel\Seller\Collection->_joinAttributeToSelect() called at [vendor/magento/module-eav/Model/Entity/Collection/AbstractCollection.php:1410]
#2 Magento\Eav\Model\Entity\Collection\AbstractCollection->_addAttributeJoin() called at [vendor/magento/module-eav/Model/Entity/Collection/AbstractCollection.php:1487]
#3 Magento\Eav\Model\Entity\Collection\AbstractCollection->_getAttributeConditionSql() called at [vendor/magento/module-eav/Model/Entity/Collection/AbstractCollection.php:372]
#4 Magento\Eav\Model\Entity\Collection\AbstractCollection->addAttributeToFilter() called at [vendor/magento/module-eav/Model/Entity/Collection/AbstractCollection.php:397]
#5 Magento\Eav\Model\Entity\Collection\AbstractCollection->addFieldToFilter() called at [vendor/smile/module-retailer-offer/Block/Catalog/Product/Retailer/Availability.php:173]
#6 Smile\RetailerOffer\Block\Catalog\Product\Retailer\Availability->getStoreOffers() called at [/srv/project/modules/atol/retailerinventory/Block/Availability.php:218]
#7 Atol\RetailerInventory\Block\Availability->getStoreOffers() called at [/srv/project/modules/atol/retailerinventory/Block/Availability.php:180]
#8 Atol\RetailerInventory\Block\Availability->getJsLayout() called at [/srv/project/modules/atol/theme-lorca-pve/Atol_RetailerInventory/templates/product/view/retailer/availability.phtml:57]
#9 include() called at [vendor/magento/framework/View/TemplateEngine/Php.php:59]
#10 Magento\Framework\View\TemplateEngine\Php->render() called at [vendor/magento/framework/View/Element/Template.php:270]
#11 Magento\Framework\View\Element\Template->fetchView() called at [vendor/magento/framework/View/Element/Template.php:300]
#12 Magento\Framework\View\Element\Template->_toHtml() called at [vendor/magento/framework/View/Element/AbstractBlock.php:667]
#13 Magento\Framework\View\Element\AbstractBlock->toHtml() called at [vendor/magento/framework/View/Layout.php:557]
#14 Magento\Framework\View\Layout->_renderBlock() called at [vendor/magento/framework/View/Layout.php:533]
#15 Magento\Framework\View\Layout->renderNonCachedElement() called at [vendor/magento/framework/View/Layout.php:488]
#16 Magento\Framework\View\Layout->renderElement() called at [vendor/magento/framework/View/Layout.php:585]
#17 Magento\Framework\View\Layout->_renderContainer() called at [vendor/magento/framework/View/Layout.php:535]
#18 Magento\Framework\View\Layout->renderNonCachedElement() called at [vendor/magento/framework/View/Layout.php:488]
#19 Magento\Framework\View\Layout->renderElement() called at [vendor/magento/framework/View/Layout.php:585]
#20 Magento\Framework\View\Layout->_renderContainer() called at [vendor/magento/framework/View/Layout.php:535]
#21 Magento\Framework\View\Layout->renderNonCachedElement() called at [vendor/magento/framework/View/Layout.php:488]
#22 Magento\Framework\View\Layout->renderElement() called at [vendor/magento/framework/View/Element/AbstractBlock.php:507]
#23 Magento\Framework\View\Element\AbstractBlock->getChildHtml() called at [/srv/project/modules/atol/theme-atolcd/Infortis_Base/templates/product/view.phtml:94]
#24 include() called at [vendor/magento/framework/View/TemplateEngine/Php.php:59]
#25 Magento\Framework\View\TemplateEngine\Php->render() called at [vendor/magento/framework/View/Element/Template.php:270]
#26 Magento\Framework\View\Element\Template->fetchView() called at [vendor/magento/framework/View/Element/Template.php:300]
#27 Magento\Framework\View\Element\Template->_toHtml() called at [vendor/magento/framework/View/Element/AbstractBlock.php:667]
#28 Magento\Framework\View\Element\AbstractBlock->toHtml() called at [vendor/magento/framework/View/Layout.php:557]
#29 Magento\Framework\View\Layout->_renderBlock() called at [vendor/magento/framework/View/Layout.php:533]
#30 Magento\Framework\View\Layout->renderNonCachedElement() called at [vendor/magento/framework/View/Layout.php:488]
#31 Magento\Framework\View\Layout->renderElement() called at [vendor/magento/framework/View/Layout.php:585]
#32 Magento\Framework\View\Layout->_renderContainer() called at [vendor/magento/framework/View/Layout.php:535]
#33 Magento\Framework\View\Layout->renderNonCachedElement() called at [vendor/magento/framework/View/Layout.php:488]
#34 Magento\Framework\View\Layout->renderElement() called at [vendor/magento/framework/View/Layout.php:585]
#35 Magento\Framework\View\Layout->_renderContainer() called at [vendor/magento/framework/View/Layout.php:535]
#36 Magento\Framework\View\Layout->renderNonCachedElement() called at [vendor/magento/framework/View/Layout.php:488]
#37 Magento\Framework\View\Layout->renderElement() called at [vendor/magento/framework/View/Layout.php:585]
#38 Magento\Framework\View\Layout->_renderContainer() called at [vendor/magento/framework/View/Layout.php:535]
#39 Magento\Framework\View\Layout->renderNonCachedElement() called at [vendor/magento/framework/View/Layout.php:488]
#40 Magento\Framework\View\Layout->renderElement() called at [vendor/magento/framework/View/Layout.php:585]
#41 Magento\Framework\View\Layout->_renderContainer() called at [vendor/magento/framework/View/Layout.php:535]
#42 Magento\Framework\View\Layout->renderNonCachedElement() called at [vendor/magento/framework/View/Layout.php:488]
#43 Magento\Framework\View\Layout->renderElement() called at [vendor/magento/framework/View/Layout.php:585]
#44 Magento\Framework\View\Layout->_renderContainer() called at [vendor/magento/framework/View/Layout.php:535]
#45 Magento\Framework\View\Layout->renderNonCachedElement() called at [vendor/magento/framework/View/Layout.php:488]
#46 Magento\Framework\View\Layout->renderElement() called at [vendor/magento/framework/View/Layout.php:585]
#47 Magento\Framework\View\Layout->_renderContainer() called at [vendor/magento/framework/View/Layout.php:535]
#48 Magento\Framework\View\Layout->renderNonCachedElement() called at [vendor/magento/framework/View/Layout.php:488]
#49 Magento\Framework\View\Layout->renderElement() called at [vendor/magento/framework/View/Layout.php:585]
#50 Magento\Framework\View\Layout->_renderContainer() called at [vendor/magento/framework/View/Layout.php:535]
#51 Magento\Framework\View\Layout->renderNonCachedElement() called at [vendor/magento/framework/View/Layout.php:488]
#52 Magento\Framework\View\Layout->renderElement() called at [vendor/magento/framework/View/Layout.php:585]
#53 Magento\Framework\View\Layout->_renderContainer() called at [vendor/magento/framework/View/Layout.php:535]
#54 Magento\Framework\View\Layout->renderNonCachedElement() called at [vendor/magento/framework/View/Layout.php:488]
#55 Magento\Framework\View\Layout->renderElement() called at [vendor/magento/framework/View/Layout.php:585]
#56 Magento\Framework\View\Layout->_renderContainer() called at [vendor/magento/framework/View/Layout.php:535]
#57 Magento\Framework\View\Layout->renderNonCachedElement() called at [vendor/magento/framework/View/Layout.php:488]
#58 Magento\Framework\View\Layout->renderElement() called at [vendor/magento/framework/View/Layout.php:954]
#59 Magento\Framework\View\Layout->getOutput() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#60 Magento\Framework\View\Layout\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#61 Magento\Framework\View\Layout\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#62 Magento\Framework\View\Layout\Interceptor->___callPlugins() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:39]
#63 Magento\Framework\View\Layout\Interceptor->getOutput() called at [vendor/magento/framework/View/Result/Page.php:257]
#64 Magento\Framework\View\Result\Page->render() called at [vendor/magento/framework/View/Result/Layout.php:170]
#65 Magento\Framework\View\Result\Layout->renderResult() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#66 Magento\Framework\View\Result\Page\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#67 Magento\Framework\View\Result\Page\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#68 Magento\Framework\View\Result\Page\Interceptor->___callPlugins() called at [generated/code/Magento/Framework/View/Result/Page/Interceptor.php:39]
#69 Magento\Framework\View\Result\Page\Interceptor->renderResult() called at [vendor/magento/framework/App/Http.php:140]
#70 Magento\Framework\App\Http->launch() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#71 Magento\Framework\App\Http\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#72 Magento\Framework\App\Http\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#73 Magento\Framework\App\Http\Interceptor->___callPlugins() called at [generated/code/Magento/Framework/App/Http/Interceptor.php:26]
#74 Magento\Framework\App\Http\Interceptor->launch() called at [vendor/magento/framework/App/Bootstrap.php:257]
#75 Magento\Framework\App\Bootstrap->run() called at [pub/index.php:37]

Invalid method could mean isScopeGlobal is not defined in attribute model class. So we checked if we had an attribute with an attribute_model of type Magento\Eav\Model\Entity\Attribute when the system is actually expecting type Magento\Catalog\Model\ResourceModel\Eav\Attribute for instance. But this track is at a dead end since we found nothing of the sort in database.

According to the stack strace, this module seems to be responsible, but we believe this bug appeared shortly after your ghost dependencies troubles between Smile_StoreLocator, Smile_Retailer and Smile_RetailerOffer. The latter precisely has a fix delivered on 1.5.1 release, but we had to fork Smile_RetailerOffer to get this fix on 1.3.8 (elasticsuite 2.6).

The most concerning part is that we are unable to reliably reproduce this bug, and it always disappears when clearing caches.

Do you have any more informations about this matter ?

Regards

Chacalbis commented 4 years ago

Since we got the fix https://github.com/Smile-SA/magento2-module-retailer-offer/commit/7c0371c5ea2e6c98d41141b55c3a085c6e9d5a32 on Smile_RetailerOffer (still 1.3.8), we didn't face this bug anymore.

Chacalbis commented 4 years ago

We reencountered this bug again, so i'm reopening this issue :p