0

after upgrading Magento to the version 2.3.2, I fixed all errors related to project code (app/code app/design) but when I try to edit a customer in back office I got an infinit loop after that error 500 displays in the browser when Xdebug is enabled I got this error message in log

[Fri Jan 24 11:17:39.065185 2020] [php7:error] [pid 31010] [client 192.168.203.1:53557] 
PHP Fatal error:  Uncaught Error: Maximum function nesting level of '15000' reached,
 aborting! in /vendor/magento/framework/ObjectManager/Config/Config.php:163\nStack trace:\n



#0 /vendor/magento/framework/ObjectManager/Config/Config.php(163): ltrim('Magento\\\\Eav\\\\Mod...', '\\\\')\n



#1 vendor/magento/framework/ObjectManager/ObjectManager.php(68): Magento\\Framework\\ObjectManager\\Config\\Config->getPreference('Magento\\\\Eav\\\\Mod...')\n

 #2 /vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(160): Magento\\Framework\\ObjectManager\\ObjectManager->get('Magento\\\\Eav\\\\Mod...')\n



#3 /vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(246): Magento\\Framework\\ObjectManager\\Factory\\AbstractFactory->resolveArgument(Array, 'Magento\\\\Eav\\\\Mod...', NULL, 'context', 'Magento\\\\Custome...')\n



#4 /vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(34): Magento\\Framework\\ObjectMa in /vendor/magento/framework/ObjectManager/Config/Config.php on line 163

after disabling Xdebug I get the error

[Fri Jan 24 17:37:42.849033 2020] [php7:error] [pid 28770] [client 192.168.203.1:56426] PHP Fatal error:  Allowed memory size of 792723456 bytes exhausted (tried to allocate 4194312 bytes) 

in /vendor/magento/framework/Api/ExtensionAttributesFactory.php on line 94, referer: http://test.loc/admin/customer/index/index/key/7874afb7590309f30f529cbcd52aaa2d59e26eec3be2820225cd10f55d09ec5d/

Any help would be appreciated

thanks in advance

2
  • 1
    Is New Relic agent enabled? Jan 24, 2020 at 21:54
  • No it is not installed in the server, this problem is in Customer Edit page (back office) only, thanks
    – lazy_coder
    Jan 26, 2020 at 20:50

1 Answer 1

0

The problem was that we got a custom attribute called parent who was being called by search criteria each time magento tries to retrieve the customer parent it load it again and again do we end up that infinite loop, to fix that problem I use now customer collection and this is code snippet :

old code :

$searchCriteria = $this->searchCriteriaBuilder
            ->addFilter(CustomerInterface::WEBSITE_ID, $customerWebsite)
            ->addFilter(CustomerInterface::HIERARCHY_LEVEL, $parentLevels, 'in')
            ->create();

        return $this->customerRepository->getList($searchCriteria);

new code :

return $customer->getCollection()
        ->addFieldToFilter(CustomerInterface::WEBSITE_ID, ['eq' => $customerWebsite])
        ->addFieldToFilter(CustomerInterface::HIERARCHY_LEVEL, ['in' => $parentLevels]);

Your Answer

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

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