0

When I try to save any categories, I am receiving the following error:

PHP Fatal error:  Uncaught Error: Call to a member function getBackend() on boolean in /var/domains/../vendor/magento/module-eav/Model/Entity/AbstractEntity.php:1666
Stack trace:
#0 /var/../vendor/magento/module-catalog-url-rewrite/Observer/CategoryUrlPathAutogeneratorObserver.php(98): Magento\Eav\Model\Entity\AbstractEntity->saveAttribute(Object(Magento\Catalog\Model\Category\Interceptor), 'url_path')
#1 /var/../vendor/magento/module-catalog-url-rewrite/Observer/CategoryUrlPathAutogeneratorObserver.php(74): Magento\CatalogUrlRewrite\Observer\CategoryUrlPathAutogeneratorObserver->updateUrlKey(Object(Magento\Catalog\Model\Category\Interceptor), 'douche')
#2 /var/../vendor/magento/framework/Event/Invoker/InvokerDefault.php(88) in /var/../vendor/magento/module-eav/Model/Entity/AbstractEntity.php on line 1666

Does anyone know what could trigger this error message and how can it be fixed ?

Thank you

| improve this question | | | | |
0

This code was responsible for updating the url_path value from here:

private function updateUrlKey($category, $urlKey)
{
    if (empty($urlKey)) {
        throw new \Magento\Framework\Exception\LocalizedException(__('Invalid URL key'));
    }
    $category->setUrlKey($urlKey)
        ->setUrlPath($this->categoryUrlPathGenerator->getUrlPath($category));
    if (!$category->isObjectNew()) {
        $category->getResource()->saveAttribute($category, 'url_path');
        if ($category->dataHasChangedFor('url_path')) {
            $this->updateUrlPathForChildren($category);
        }
    }
}

In my case, not sure how, but the url_pathfrom the eav_attribute table got removed, so I needed to recreate it !

| improve this answer | | | | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.