luismartin Posted August 13, 2013 Share Posted August 13, 2013 I'm testing the "Creating a Prestashop Module" tutorial for Prestashop 1.5. My version is 1.5.4.1. Link to the tut: http://doc.prestasho...estaShop+module I think I've done all the steps in it but when I try to load the module I get this error: - mymodule :The version of your module is not compliant with your PrestaShop version. This is the code in mymodule.php, just about the same as in the tutorial: <?php if (!defined('_PS_VERSION_')) exit; class MyModule extends Module { public function __construct() { $this->name = 'mymodule'; $this->tab = 'front_office_features'; $this->version = '1.0'; $this->author = 'Luis Martin'; $this->need_instance = 0; $this->ps_versions_compliancy = array('min' => '1.5', 'max' => '1.5'); //$this->dependencies = array('blockcart'); parent::__construct(); $this->displayName = $this->l('My module'); $this->description = $this->l('Description of my module.'); $this->confirmUninstall = $this->l('Are you sure you want to uninstall?'); if (!Configuration::get('MYMODULE_NAME')) $this->warning = $this->l('No name provided'); } /** * Extra actions on installation * @return bool */ public function install() { if (Shop::isFeatureActive()) Shop::setContext(Shop::CONTEXT_ALL); return parent::install() && $this->registerHook('leftColumn') && $this->registerHook('header') && Configuration::updateValue('MYMODULE_NAME', 'Hola amigo!'); } /** * Extra actions on unistallation * @return bool */ public function uninstall() { return parent::uninstall() && Configuration::deleteByName('MYMODULE_NAME'); } } Am I missing something? ps: sorry for the code indentation. This editor is terrible! Link to comment Share on other sites More sharing options...
benjamin utterback Posted August 13, 2013 Share Posted August 13, 2013 Hi! before you add the bootstrap lines, when you add the folder into the /modules folder, can you see it in your Modules page in the back-office? 1 Link to comment Share on other sites More sharing options...
bellini13 Posted August 13, 2013 Share Posted August 13, 2013 i would comment out this line of code [color=#000000]$this->ps_versions_compliancy = array('min' => '1.5', 'max' => '1.5'); [/color] Your version of Prestashop 1.5.4.1 exceeds the max 1.5. Either change the max or comment it out 2 Link to comment Share on other sites More sharing options...
luismartin Posted August 14, 2013 Author Share Posted August 14, 2013 Hi, thanks for your replies. Bellini13: Commenting out that line worked! But the tutorial should be revised, since it says that '1.5' stands for any '1.5.x' subversion: ps_versions_compliancy is new since PrestaShop 1.5. It clearly indicates which version of PrestaShop this module is compatible with. In the example above, we explicitly write that this module will only work with PrestaShop 1.5.x, and no other major version. I was totally convinced that this line should be stated that way to indicate any 1.5.x.x version. I even used '1.5.4.1' as the value for 'max' but didn't work either. Benjamin: the module was in fact listed in the modules list in the backend. Then I clicked on the Install button, and the error message appeared. But it is already solved. Regards! Link to comment Share on other sites More sharing options...
bellini13 Posted August 14, 2013 Share Posted August 14, 2013 I would not rely on this attribute anyway. It does not exist outside of PS v1.5, and would not prevent the module from being used in lower versions of Prestashop, since they are not aware of it. Most developers add their own version checks since it would work on any PS version Link to comment Share on other sites More sharing options...
Padmaja Posted January 11, 2014 Share Posted January 11, 2014 (edited) Hi I created one user-defined module in prestashop. when click on the install button at back office the module was installed. But error:modules were not installed properly message is displaying. I don't want to display that error. Please help me. Thankyou Edited January 11, 2014 by Padmaja (see edit history) 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