0

I am facing below issue in server. It's working fine in my local but in server not working. This error coming while saving the newsletter in My Account page, Sign Up Newsletter in registration page.

Fatal error: Uncaught TypeError: Argument 1 passed to Magento\Eav\Model\Entity\Attribute\Source\Config::__construct() must be of the type array, null given, called in /chroot/home/sitehtml/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 93 and defined in /chroot/home/sitehtml/vendor/magento/module-eav/Model/Entity/Attribute/Source/Config.php:26 Stack trace: #0 /chroot/home/sitehtml/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(93): Magento\Eav\Model\Entity\Attribute\Source\Config->__construct(NULL) #1 /chroot/home/sitehtml/vendor/magento/framework/ObjectManager/Factory/Compiled.php(88): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Magento\\Eav\\Mod...', Array) #2 /chroot/home/sitehtml/vendor/magento/framework/ObjectManager/ObjectManager.php(57): Magento\Framework\ObjectManager\Factory\Compiled->create('Magento\\Eav\\Mod...', Array) #3 / in /chroot/home/sitehtml/vendor/magento/module-eav/Model/Entity/Attribute/Source/Config.php on line 26

For this error I tried the php bin/setup:di:compile command but no use and I deleted the files in var/generation,var/di, var/cache and I tried the same command but still same issue coming. Please tell me any idea to fix this.

  • is there mailchimp extension ? – Mukesh Prajapati Apr 19 '18 at 6:57
  • Yes I have Ebizmarts_Mailchimp. Is there any problem? – Jeeva Chezhiyan Apr 19 '18 at 6:59
  • Please disable that and check is that works ? – Mukesh Prajapati Apr 19 '18 at 7:07
  • I have faced this issue in magento 1 so – Mukesh Prajapati Apr 19 '18 at 7:08
  • Ok i'll check and let you know dude – Jeeva Chezhiyan Apr 19 '18 at 7:11
1

In mailchimp extension go to helper/data.php file

find

try {
                if($item->usesSource()) {
                    $options = $item->getSource()->getAllOptions();
                } else {
                    $options = [];
                }

Replace with

   try {
                  if($item->getFrontendInput()=='select'){
                    $options =$item->getSource()->getAllOptions();
                  }
                else{
                  $options = [];
                }
                }
                catch(\Exception $e) {

                    $options = [];
                }

I think it should work

  • @JeevaChezhiyan ok i need upvote if you found this useful – Mukesh Prajapati Apr 19 '18 at 7:35

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.