Jump to content

Module development for older versions (1.5.0.1)


teomor

Recommended Posts

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 by teomor (see edit history)
Link to comment
Share on other sites

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 by teomor (see edit history)
Link to comment
Share on other sites

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 by teomor (see edit history)
Link to comment
Share on other sites

By the way, my admin tab works in 1.5.1.0 but doesn't in 1.5.0.1
I 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

  • 4 months later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...