Updated: Changes for PHP 8.x compatibility
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
#[\AllowDynamicProperties]
|
||||
abstract class ModuleCore
|
||||
{
|
||||
/** @var int Module ID */
|
||||
@@ -66,6 +67,12 @@ abstract class ModuleCore
|
||||
/** @var string Module key provided by addons.prestashop.com */
|
||||
public $module_key = '';
|
||||
|
||||
/** @var bool Set to true to enable bootstrap theme on configuration page */
|
||||
public $bootstrap = false;
|
||||
|
||||
/** @var string Text to display when ask for confirmation on uninstall action */
|
||||
public $confirmUninstall = '';
|
||||
|
||||
public $description_full;
|
||||
|
||||
public $additional_description;
|
||||
@@ -81,6 +88,9 @@ abstract class ModuleCore
|
||||
/** @var int need_instance */
|
||||
public $need_instance = 1;
|
||||
|
||||
/** @var int */
|
||||
public $is_configurable = 0;
|
||||
|
||||
/** @var string Admin tab corresponding to the module */
|
||||
public $tab = null;
|
||||
|
||||
@@ -162,6 +172,9 @@ abstract class ModuleCore
|
||||
|
||||
public $push_time_limit = 180;
|
||||
|
||||
/** @var bool Define if we will populate data during installation */
|
||||
public $populateData = 0;
|
||||
|
||||
/** @var bool Define if we will log modules performances for this session */
|
||||
public static $_log_modules_perfs = null;
|
||||
/** @var bool Random session for modules perfs logs*/
|
||||
@@ -238,7 +251,7 @@ abstract class ModuleCore
|
||||
* @param string $name Module unique name
|
||||
* @param Context $context
|
||||
*/
|
||||
public function __construct($name = null, Context $context = null)
|
||||
public function __construct($name = null, ?Context $context = null)
|
||||
{
|
||||
// for Prestashop version compliancy
|
||||
if (isset($this->ps_versions_compliancy) && !isset($this->ps_versions_compliancy['min'])) {
|
||||
@@ -1440,7 +1453,7 @@ abstract class ModuleCore
|
||||
$item->version = $tmp_module->version;
|
||||
$item->tab = $tmp_module->tab;
|
||||
$item->displayName = $tmp_module->displayName;
|
||||
$item->description = stripslashes($tmp_module->description);
|
||||
$item->description = isset($tmp_module->description) ? stripslashes($tmp_module->description) : null;
|
||||
$item->author = $tmp_module->author;
|
||||
$item->author_uri = (isset($tmp_module->author_uri) && $tmp_module->author_uri) ? $tmp_module->author_uri : false;
|
||||
$item->limited_countries = $tmp_module->limited_countries;
|
||||
@@ -1452,7 +1465,7 @@ abstract class ModuleCore
|
||||
$item->currencies = isset($tmp_module->currencies) ? $tmp_module->currencies : null;
|
||||
$item->currencies_mode = isset($tmp_module->currencies_mode) ? $tmp_module->currencies_mode : null;
|
||||
$item->confirmUninstall = isset($tmp_module->confirmUninstall) ? html_entity_decode($tmp_module->confirmUninstall) : null;
|
||||
$item->description_full = stripslashes($tmp_module->description_full);
|
||||
$item->description_full = isset($tmp_module->description_full) ? stripslashes($tmp_module->description_full) : null;
|
||||
$item->additional_description = isset($tmp_module->additional_description) ? stripslashes($tmp_module->additional_description) : null;
|
||||
$item->compatibility = isset($tmp_module->compatibility) ? (array)$tmp_module->compatibility : null;
|
||||
$item->nb_rates = isset($tmp_module->nb_rates) ? (array)$tmp_module->nb_rates : null;
|
||||
@@ -3191,6 +3204,7 @@ abstract class ModuleCore
|
||||
|
||||
// Make a reflection of the override class and the module override class
|
||||
$overrideClassFileArray = file($overrideClassFilePath);
|
||||
|
||||
eval(
|
||||
preg_replace(
|
||||
array(
|
||||
|
||||
Reference in New Issue
Block a user