Getting this error when reload page after adding value programmatically in a custom attribute. And when i delete that value which i added programmatically then its working fine.
Error filtering template: Notice: Undefined offset: 1 in
/home/tunxxx/public_html/xxxxxx.com/app/design/frontend/Etheme/yourstore/Nwdthemes_Revslider/templates/revslider.phtml on line 87
i am using below given code for addding attribute value programatically.
<?php
// $attribute_model = $this->_objectManager->create('Magento\Eav\Model\Entity\Attribute');
$objectManager1 = \Magento\Framework\App\ObjectManager::getInstance();
$attribute_model = $objectManager1->create('Magento\Eav\Model\Entity\Attribute');
$attribute_code = $attribute_model->getIdByCode('catalog_product', 'ymmk_model');
$attribute = $attribute_model->load($attribute_code);
$value[0] = array('rrrrrrrrrfrrr','');
$result = array('value' => $value);
$attribute->setData('option',$result);
$attribute->save();
?>