MrGumby Posted March 24, 2014 Share Posted March 24, 2014 (edited) I added some columns into database for storing additional data and I want to reach that data through adminController, I write Class and Controller override in /modules/my_module/override but when I try to run the controller, it throws exception: Identifier or table format not valid for class Manufacturer at line 189 in file classes/ObjectModel.php As seen, I override Manufacturer class and AdminManufacturerController. I added column 'ean_gpc' into 'ps_manufacturer' table. I store first 7 digits from ean there - this sequence should identifiy manufacturer - I want to be able to edit that sequence when edit manufacturer in back office. Therefore I create class override <?php // my_module/override/classes/Manufacturer.php class Manufacturer extends ManufacturerCore { /** @var string EAN-GPC */ public $ean_gpc; public function __construct($id = null, $id_lang = null) { self::$definition['fields']['ean_gpc'] = array('type' => self::TYPE_STRING, 'validate' => 'isUnsignedInt', 'size' => 7); parent::__construct($id, $id_lang); } } controller override <?php // my_module/override/controllers/admin/AdminManufacturersController.php class AdminManufacturersController extends AdminManufacturersControllerCore { public function renderForm() { // ...not changed $this->fields_form = array( 'tinymce' => true, 'legend' => array( 'title' => $this->l('Manufacturers'), 'icon' => 'icon-certificate' ), 'input' => array( // ...added one input nearly at the end of inputs: array( 'type' => 'text', 'label' => 'EAN-GPC', 'name' => 'ean_gpc', 'col' => 2, 'hint' => $this->l('First 7 digits of EAN13 that identifies manufacturer') ), // ... not changed ) ) ); // ... not changed } } When i write this changes directly int PS core files (just for test), it works, but when I try to override from module, then it fails at following test in ObjectModel: if (!Validate::isTableOrIdentifier($this->def['primary']) || !Validate::isTableOrIdentifier($this->def['table'])) throw new PrestaShopException('Identifier or table format not valid for class '.get_class($this)); Any suggestions? Edit: type errors Edited March 24, 2014 by MrGumby (see edit history) Link to comment Share on other sites More sharing options...
MrGumby Posted March 24, 2014 Author Share Posted March 24, 2014 If anyone is courious, here is the whole module. It do not do anything usefull yet, just installs, override and basic configuration form... Link to comment Share on other sites More sharing options...
MrGumby Posted March 25, 2014 Author Share Posted March 25, 2014 My brain betrayed me again. He and my eyes. I wrote wrong name of controllers folder inside module/override, and it gets me two days to find it! I should not bought this high DPI display. Anyway, now it is working. Sorry for wasting database. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now