teomor Posted January 7, 2015 Share Posted January 7, 2015 (edited) I am trying to develop a small module that is supposed to work on PrestaShop 1.5.0.1 and I am having some trouble with the simple creation of a page in the admin. This is my install code: $parent_tab = new Tab(); $parent_tab->name[$this->context->language->id] = $this->l('Test Title'); $parent_tab->class_name = 'AdminTestModuleMain'; $parent_tab->module = $this->name; $parent_tab->id_parent = 0; $parent_tab->add(); and in my module folder I have created a 'controllers/admin/AdminTestModuleMain.php' file with the following code: class AdminTestModuleMainController extends AdminController { } The newly created admin tab shows up (as a separate tab in the menu) but when I click on it I get a fatal error: Fatal error: Class 'AdminTestModuleMainController' not found in /var/www/classes/Controller.php on line 115 I have tried different names for the class, for the controller file, deleting the class_index.php file, disabling cache and also tried to install the module on 1.5.4.0 (and the menu doesn't even show up). I also downloaded a simple addon (that is compatible with 1.5.0.1) from the marketplace and installed it and I get the same fatal error (class not found). I did the same thing with this module in 1.5.4.0 and this module works there.... I don't understand what is going on.. Edited January 7, 2015 by teomor (see edit history) Link to comment Share on other sites More sharing options...
fred-vinapresta Posted January 7, 2015 Share Posted January 7, 2015 I remember that there was, in admin menu, a tab button for administrate the new admin custom tab. It enabled to choose which controller will be linked to this tab. But not sure if it was just in 1.4 or also in earlier 1.5 prestashop version Link to comment Share on other sites More sharing options...
teomor Posted January 7, 2015 Author Share Posted January 7, 2015 (edited) That doesn't work for me. I need the module to create the admin tab, not the user. This will be a free module that people will install and just work.Anyway, the tab shows up, but the page returns a fatal error. That's my main issue... Somehow, the controller is not registered in the system.. Edited January 7, 2015 by teomor (see edit history) Link to comment Share on other sites More sharing options...
fred-vinapresta Posted January 7, 2015 Share Posted January 7, 2015 Did you try to put your controller in a controllers/admin folder in the root of your module, and if you controller is called default.php for example, name the class: class YourModuleNameDefaultModuleAdminController extends ModuleAdminController { ...... your controller code.... } Link to comment Share on other sites More sharing options...
teomor Posted January 7, 2015 Author Share Posted January 7, 2015 (edited) Do you mean that there a specific naming convention for older versions that I am anware of? PS: this class called ModuleAdminController that I encounter all over the forums, does not exist in 1.5.0.1 I have no idea what this is...PPS: I have tried your suggestions and they don't work. Edited January 7, 2015 by teomor (see edit history) Link to comment Share on other sites More sharing options...
teomor Posted January 8, 2015 Author Share Posted January 8, 2015 By the way, my admin tab works in 1.5.1.0 but doesn't in 1.5.0.1I would hate to try every other version in between to find out which one works and which one doesn't and I couldn't find anything relevant in the change logs... Link to comment Share on other sites More sharing options...
Chrims Posted May 19, 2015 Share Posted May 19, 2015 Bump.. Im looking for an answer too :-D Link to comment Share on other sites More sharing options...
teomor Posted May 19, 2015 Author Share Posted May 19, 2015 (edited) Stop looking. There is no good answer. I moved on to newer versions, as I found lots of undocumented bugs that interfered with my module. I ended up with 1.5.0.15 as the min version for my module.. Edited May 19, 2015 by teomor (see edit history) Link to comment Share on other sites More sharing options...
Chrims Posted May 19, 2015 Share Posted May 19, 2015 Would you say that PS Versions smaller as 1.5.1 are irrelevant for selling modules? Link to comment Share on other sites More sharing options...
teomor Posted May 19, 2015 Author Share Posted May 19, 2015 No, I can't say that. It really depends on the module. If it doesn't require lots of admin pages, for instance, you don't even need to create a separate admin tab for it.. 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