Magento News

 

Magento – Strange problem when editing a file after using Module Creator

I’m using the Module Creator to create a custom module.

The module is working, but I can’t edit the files that are created.
I’ve downloaded the files of the custom module and tried to edit the setup file from :

<?php

$installer = $this;
$installer->startSetup();
$installer->run("

-- DROP TABLE IF EXISTS {$this->getTable('banners')};
CREATE TABLE {$this->getTable('banners')} (
  `banners_id` int(11) unsigned NOT NULL auto_increment,
  `title` varchar(255) NOT NULL default '',
  `filename` varchar(255) NOT NULL default '',
  `content` text NOT NULL default '',
  `status` smallint(6) NOT NULL default '0',
  `created_time` datetime NULL,
  `update_time` datetime NULL,
  PRIMARY KEY (`banners_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
");

$installer->endSetup();

to:

<?php

$installer = $this;
$installer->startSetup();
$installer->run("

-- DROP TABLE IF EXISTS {$this->getTable('banners')};
CREATE TABLE {$this->getTable('banners')} (
  `banners_id` int(11) unsigned NOT NULL auto_increment,
  `title` varchar(255) NOT NULL default '',
  `filename1` varchar(255) NOT NULL default '',
  `content` text NOT NULL default '',
  `status` smallint(6) NOT NULL default '0',
  `created_time` datetime NULL,
  `update_time` datetime NULL,
  PRIMARY KEY (`banners_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
");

$installer->endSetup();

I added the number 1 in the filename field. When I upload the changed file, I get an error when I try to run the module:

Parse error: syntax error, unexpected T_VARIABLE in /home/.../public_html/shevypro/app/code/local/Zone/Banners/sql/banners_setup/mysql4-install-0.1.0.php on line 1

Even if I undo the changes in the file (ctrl+z) and re-upload the file, I still get the same problem.

What can cause this?

Magento – Strange problem when editing a file after using Module Creator

Possibly Related Posts:


 

Leave a Reply