Migrate Magento 2.0 site and got warning Invalid argument supplied for foreach() vendor/magento/module-eav/Model/Config.php on line 280

Need help, In migration of website magento 2.0 i got the following warning. Warning: Invalid argument supplied for foreach() in public_html/vendor/magento/module-eav/Model/Config.php on line 280 #0 public_html/vendor/magento/module-eav/Model/Config.php(280): Magento\Framework\App\ErrorHandler->handler(2, ‘Invalid argumen…’, ‘/home/danielvin…’, 280, Array) #1 public_html/vendor/magento/module-eav/Model/Config.php(327): Magento\Eav\Model\Config->_initEntityTypes() #2 public_html/vendor/magento/module-eav/Model/Entity/AbstractEntity.php(290): Magento\Eav\Model\Config->getEntityType(‘customer’) #3 public_html/vendor/magento/module-customer/Model/ResourceModel/Customer.php(64): Magento\Eav\Model\Entity\AbstractEntity->setType(‘customer’) #4 public_html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(111): Magento\Customer\Model\ResourceModel\Customer->__construct(Object(Magento\Eav\Model\Entity\Context), Object(Magento\Framework\Model\ResourceModel\Db\VersionControl\Snapshot), Object(Magento\Framework\Model\ResourceModel\Db\VersionControl\RelationComposite), Object(Magento\Framework\App\Config), Object(Magento\Framework\Validator\Factory), Object(Magento\Framework\Stdlib\DateTime), Object(Magento\Store\Model\StoreManager), Array) #5 public_html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(89): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject(‘Magento\\Custome…’, Array)…

Refund using credit memo does not include tips

I am trying to issue refunds using the following code: $serviceOrder = Mage::getModel(‘sales/service_order’, $order); $data = array( ‘shipping_amount’=>$order[‘shipping_amount’], ‘grand_total’=>$order[‘grand_total’], ‘base_grand_total’=>$order[‘base_grand_total’], ‘adjustment_positive’=>$positive – $refundedFromGiftCard, ‘adjustment_negative’=>$negative, ‘qtys’=>$items, ); $creditmemo = $serviceOrder->prepareInvoiceCreditmemo($invoice,$data); $creditmemo->setRefundRequested(true) ->setShippingAmount($order[‘shipping_amount’]) ->setGrandTotal($order[‘grand_total’]) ->setOfflineRequested(false) ->load()->refund(); $transaction = Mage::getModel(‘core/resource_transaction’); $transaction->addObject($creditmemo) ->addObject($creditmemo->getOrder()) ->addObject($creditmemo->getInvoice()) ->save(); However, whenever I do a refund of x amount(full/partial) for an order with shipping…