baldwin-agency / magento2-module-url-data-integrity-checker

Magento 2 module which can find potential url related problems in your catalog data
MIT License
261 stars 28 forks source link

Call to undefined method on all backend views / incompatible with firecheckout #15

Closed Morgy93 closed 3 years ago

Morgy93 commented 3 years ago

/baldwin_urldataintegritychecker/catalog_category_urlPath/:

Call to undefined method Baldwin\UrlDataIntegrityChecker\Model\ResourceModel\Catalog\Category\UrlPathCollection\Interceptor::getMainTable()
Exception in vendor/swissup/module-checkout-fields/Plugin/Ui/Component/OrderListingData.php:42

/baldwin_urldataintegritychecker/catalog_category_urlKey/:

Call to undefined method Baldwin\UrlDataIntegrityChecker\Model\ResourceModel\Catalog\Category\UrlKeyCollection\Interceptor::getMainTable()
Exception in vendor/swissup/module-checkout-fields/Plugin/Ui/Component/OrderListingData.php:42

/baldwin_urldataintegritychecker/catalog_product_urlPath/:

Call to undefined method Baldwin\UrlDataIntegrityChecker\Model\ResourceModel\Catalog\Product\UrlPathCollection\Interceptor::getMainTable()
Exception in vendor/swissup/module-checkout-fields/Plugin/Ui/Component/OrderListingData.php:42

/baldwin_urldataintegritychecker/catalog_product_urlKey/:

Call to undefined method Baldwin\UrlDataIntegrityChecker\Model\ResourceModel\Catalog\Product\UrlKeyCollection\Interceptor::getMainTable()
Exception in vendor/swissup/module-checkout-fields/Plugin/Ui/Component/OrderListingData.php:42

Is this something that can be fixed here or do I need to address conflicting module? It's https://www.firecheckout.net/ by https://swissuplabs.com/

hostep commented 3 years ago

Thanks for the report @Morgy93

But at first sight, it doesn't look like there is something our module is doing wrong here. If you disagree, then please specify more details, like what that Plugin from the firecheckout module tries to achieve.

Morgy93 commented 3 years ago

Well the exception is thrown here line 42:

41: if ($this->helper->isEnabled() &&
42:     $result->getMainTable() === $result->getTable('sales_order_grid')
43: ) {

It says that getMainTable() is missing from Baldwin\UrlDataIntegrityChecker\Model\ResourceModel\Catalog\Category\UrlPathCollection\Interceptor but $result is usually a default Magento class: \Magento\Framework\Api\Search\SearchResultInterface $result So maybe you're extending/overwriting/implementing something wrong here so that the method cannot be found anymore?

hostep commented 3 years ago

I'm not particularly happy with how we implemented the grid since we don't use data from the database (yet) as source for its content and I needed to hack my way around this somewhat. But the interfaces we inherit from don't force us to implement the getMainTable method, so I'm not sure what we are doing wrong here. The bug is probably in the firecheckout module but it's hard to say without more info. Have the devs from that module already investigated this? This module is open source so they should be able to quickly test it.

However, I'm considering migrating the grid we use in this module to https://github.com/hyva-themes/magento2-hyva-admin because it sounds like a lot of fun. If that happens one day, I think that this issue might be solved by no longer using the default Magento backend grids.

hostep commented 3 years ago

Hi @Morgy93: can you check https://github.com/baldwin-agency/magento2-module-url-data-integrity-checker/issues/8#issuecomment-791351623 and let me know if this fixes it as well for you? Then we can close this ticket, thanks!

Morgy93 commented 3 years ago

Works like a charm, thanks!

Closed~