Magento – Troubleshooting File Loading from SRC Folder

databasemagento-1.7magento-1.8magento-1.9module

Error in file:
"/var/www/test/magento_custom/app/code/community/Fabric/Material/data/fabric_material_setup/data-install-1.0.0.0.1.php"
-Warning: include(/var/www/test/magento_custom/includes/src/Fabric_Material_Model_Material.php):
failed to open stream: No such file or directory in
/var/www/test/magento_custom/includes/src/Varien_Autoload.php on line
94

I am having this issue, when install custom module. What would be the issue?

sql setup file.

$installer = $this;

/**
 * Creating table fabric_news
 */
$table = $installer->getConnection()
    ->newTable($installer->getTable('fabric_material/material'))
    ->addColumn('news_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
        'unsigned' => true,
        'identity' => true,
        'nullable' => false,
        'primary'  => true,
    ), 'Entity id')
    ->addColumn('title', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array(
        'nullable' => true,
    ), 'Title')
    ->addColumn('author', Varien_Db_Ddl_Table::TYPE_TEXT, 63, array(
        'nullable' => true,
        'default'  => null,
    ), 'Author')
    ->addColumn('content', Varien_Db_Ddl_Table::TYPE_TEXT, '2M', array(
        'nullable' => true,
        'default'  => null,
    ), 'Content')
    ->addColumn('image', Varien_Db_Ddl_Table::TYPE_TEXT, null, array(
        'nullable' => true,
        'default'  => null,
    ), 'News image media path')
    ->addColumn('published_at', Varien_Db_Ddl_Table::TYPE_DATE, null, array(
        'nullable' => true,
        'default'  => null,
    ), 'World publish date')
    ->addColumn('created_at', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null, array(
        'nullable' => true,
        'default'  => null,
    ), 'Creation Time')
    ->addIndex($installer->getIdxName(
            $installer->getTable('fabric_material/material'),
            array('published_at'),
            Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX
        ),
        array('published_at'),
        array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX)
    )
    ->setComment('Material item');

$installer->getConnection()->createTable($table);

data setup file.

$installer = $this;

/**
 * @var $model Fabric_News_Model_News
 */
$model = Mage::getModel('fabric_material/material');

// Set up data rows
$dataRows = array(
    array(
        'title'          => 'Cotton',
        'content'        => '<p>Suitable for very sunny climate</p>',
        'created_at'=>'2015-02-13 13:14:47'
    ),
     array(
        'title'          => 'Synthetic',
        'content'        => '<p>Suitable for very sunny climate</p>',
        'created_at'=>'2015-02-13 13:14:47'
    )
);
// Generate news items
foreach ($dataRows as $data) {
    $model->setData($data)->setOrigData()->save();
}

Best Answer

I found answer from below link. The Problem is that I enabled compilation in

System->Tool->compilation.

That is why, Magento duplicate everything in modules into src. Because of this, Errors have come.

Answer Here

Related Topic