//small fix on version compare for install module

This commit is contained in:
Vincent Augagneur committed 2013-09-05 10:33:15 +02:00
1 parent 5fa8cc4d47
commit 009536d3f4
1 file changed
+3 -2
+3 -2
View File
@@ -40,7 +40,7 @@ abstract class ModuleCore
public $registered_version; public $registered_version;
/** @var array filled with known compliant PS versions */ /** @var array filled with known compliant PS versions */
public $ps_versions_compliancy = array('min' => '1.4', 'max' => '1.6'); public $ps_versions_compliancy = array();
/** @var array filled with modules needed for install */ /** @var array filled with modules needed for install */
public $dependencies = array(); public $dependencies = array();
@@ -138,6 +138,7 @@ abstract class ModuleCore
*/ */
public function __construct($name = null, Context $context = null) public function __construct($name = null, Context $context = null)
{ {
$this->ps_versions_compliancy = array('min' => '1.4', 'max' => _PS_VERSION_);
// Load context and smarty // Load context and smarty
$this->context = $context ? $context : Context::getContext(); $this->context = $context ? $context : Context::getContext();
if (is_object($this->context->smarty)) if (is_object($this->context->smarty))
@@ -200,7 +201,7 @@ abstract class ModuleCore
} }
// Check PS version compliancy // Check PS version compliancy
if (version_compare(_PS_VERSION_, $this->ps_versions_compliancy['min']) < 0 || version_compare(_PS_VERSION_, $this->ps_versions_compliancy['max']) >= 0) if (version_compare(_PS_VERSION_, $this->ps_versions_compliancy['min']) < 0 || version_compare(_PS_VERSION_, $this->ps_versions_compliancy['max']) > 0)
{ {
$this->_errors[] = $this->l('The version of your module is not compliant with your PrestaShop version.'); $this->_errors[] = $this->l('The version of your module is not compliant with your PrestaShop version.');
return false; return false;