I have developed a module store view pricing in which I have edited price attribute's scope. Whenever I install that extension of time below warning populates during setup: upgrade in the command window
Warning: array_merge(): Argument #1 is not an array /var/www/html/magento219/vendor/magento/framework/App/Config/Initial/Converter.php on line 78
Could anyone tell the reason about that? It is because of extension bug or a core bug? This is code to edit price attribute:
use Magento\Eav\Setup\EavSetup;
use Magento\Eav\Setup\EavSetupFactory;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Framework\Setup\InstallDataInterface;
/**
* InstallData for install Database for StoreViewPricing
*/
class InstallData implements InstallDataInterface
{
/**
* eav Setup Factory
*
* @var \Magento\Eav\Setup\EavSetupFactory
*/
private $eavSetupFactory;
/**
* @param \Magento\Eav\Setup\EavSetupFactory $eavSetupFactory
*/
public function __construct(EavSetupFactory $eavSetupFactory)
{
$this->eavSetupFactory = $eavSetupFactory;
}
/**
* @param \Magento\Framework\Setup\ModuleDataSetupInterface $setup
* @param \Magento\Framework\Setup\ModuleContextInterface $context;
*/
public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
{
/** @var EavSetup $eavSetup */
$eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
$entityType = $eavSetup->getEntityTypeId('catalog_product');
$eavSetup->updateAttribute($entityType, 'price', 'is_global',0);
}
}
I have add condition
&& is_array($nodeData) at vendor/magento/framework/App/Config/Initial/Converter.php on line 78
for temporary solution
if (is_array($childrenData) && is_array($nodeData)) {
$nodeData = array_merge($nodeData, $childrenData);
} else {
$nodeData = $childrenData;
}
My Module.xml is
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
<module name="Mageants_StoreViewPricing" schema_version="2.0.0" setup_version="2.0.0" active="true">
<sequence>
<module name="Magento_Catalog"/>
<module name="Magento_Directory"/>
</sequence>
</module>
</config>
I know it's wrong to edit core files so i need permanent solution if any one can help on this.
Thank you