When I add a configurable product in Magento CE 2.2.3, I try to add variations. No problems so far. When I return to the product edit screen I see the variations. When I try to save the product I get the following error (changed user and domain).

Got error

PHP message: PHP Fatal error:  Uncaught Error: Call to undefined method Magento\\Catalog\\Model\\Product\\Type\\Simple::getConfigurableAttributeCollection() in vendor/magento/module-configurable-product/Helper/Product/Options/Loader.php:52
Stack trace:
#0 vendor/magento/module-configurable-product/Model/Product/ReadHandler.php(48): Magento\\ConfigurableProduct\\Helper\\Product\\Options\\Loader->load(Object(Magento\\Catalog\\Model\\Product\\Interceptor))
#1 vendor/magento/framework/EntityManager/Operation/Read/ReadExtensions.php(48): Magento\\ConfigurableProduct\\Model\\Product\\ReadHandler->execute(Object(Magento\\Catalog\\Model\\Product\\Interceptor), Array)
#2 vendor/magento/framework/EntityManager/Operation/Read.php(112): Magento\\Framework\\EntityManager\\Operation\\Read\\ReadExtensions->execute(Object(Magento\\Catalog\\Model\\Product\\Interce...', 
referer: http://domain.com/admin/catalog/product/edit/id/4670/set/54/type/configurable/store/0/key/3c6931241c19f977a1c6f03ae3207a09140b29c47712291add87d3fcd84df4da/back/edit/

Please help.

5 Answers 5


I had the same problem and when I changed




the problem disappeared.

  • I have the same issue.Did you edited in this path /root_dir/vendor/magento/module-configurable-product/Helper/Product/Options/Loader.php
    – Vindhuja
    Commented May 23, 2019 at 12:16
  • No. Never edit core files!
    – Zsolti
    Commented May 24, 2019 at 11:53
  • Then, where did yoy edit. Did youoverrided this file
    – Vindhuja
    Commented May 27, 2019 at 4:18
  • Most probably I've overridden it.
    – Zsolti
    Commented May 28, 2019 at 13:18
  • It works for me. Commented Dec 8, 2021 at 9:31

Check your custom modules or extensions and find if you are using either of the following -:

Magento\Catalog\Model\Product (in the constructor)




If yes then change it to use \Magento\Catalog\Api\ProductRepositoryInterface and load product using getById($id) instead. Hope it helps

source: - https://github.com/magento/magento2/issues/21663#issuecomment-674535792


Is not recommended edit the core files either magento or any framework. I made one override to the class. I don't know if there is a best way to fix this issue, but for mi works.


<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Magento\ConfigurableProduct\Helper\Product\Options\Loader"


 * Copyright ©  All rights reserved.
 * See COPYING.txt for license details.

namespace Custom\Module\Helper\Product\Options;

use Magento\Catalog\Api\Data\ProductInterface;
use Magento\ConfigurableProduct\Api\Data\OptionInterface;
use Magento\ConfigurableProduct\Model\Product\Type\Configurable;
use Magento\ConfigurableProduct\Api\Data\OptionValueInterfaceFactory;
use Magento\Framework\Api\ExtensionAttribute\JoinProcessorInterface;

 * Class Loader
 * @package Custom\Module\Helper\Product\Options
class Loader extends \Magento\ConfigurableProduct\Helper\Product\Options\Loader
     * @var OptionValueInterfaceFactory
    private $optionValueFactory;

     * @var JoinProcessorInterface
    private $extensionAttributesJoinProcessor;

     * Loader constructor.
     * @param OptionValueInterfaceFactory $optionValueFactory
     * @param JoinProcessorInterface $extensionAttributesJoinProcessor
    public function __construct(
        OptionValueInterfaceFactory $optionValueFactory,
        JoinProcessorInterface $extensionAttributesJoinProcessor
    ) {
        $this->optionValueFactory = $optionValueFactory;
        $this->extensionAttributesJoinProcessor = $extensionAttributesJoinProcessor;

     * @param ProductInterface $product
     * @return OptionInterface[]
    public function load(ProductInterface $product): array
        $options = [];
        /** @var Configurable $typeInstance */
        $typeInstance = $product->getTypeInstance();
        if ($typeInstance instanceof \Magento\Catalog\Model\Product\Type\Simple ||
            $typeInstance instanceof \Magento\Bundle\Model\Product\Type) {
            return $options;

        $attributeCollection = $typeInstance->getConfigurableAttributeCollection($product);
        foreach ($attributeCollection as $attribute) {
            $values = [];
            $attributeOptions = $attribute->getOptions();
            if (is_array($attributeOptions)) {
                foreach ($attributeOptions as $option) {
                    /** @var \Magento\ConfigurableProduct\Api\Data\OptionValueInterface $value */
                    $value = $this->optionValueFactory->create();
                    $values[] = $value;
            $options[] = $attribute;

        return $options;

I found this error also occurs when trying to access the admin catalog grid..

This query to DB to resets any admin filters tied to your user ID:

DELETE FROM ui_bookmark WHERE user_id = <YOUR_USER_ID>;

This worked for me.


This is a core issue in Magento 2. Here is the issue url: https://github.com/magento/magento2/issues/21663

You can try these two answers in the above issue:

  1. https://github.com/magento/magento2/issues/21663#issuecomment-477966963

  2. https://github.com/magento/magento2/issues/21663#issuecomment-501121021

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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