webbay.pl Posted February 13, 2018 Share Posted February 13, 2018 I have problem with module. What is wrong? Please help me. I changed $_POST on Tools::getValue and Tools::getIsset- now Prestashop required this method in validator. Return bug in panel administration: [PrestaShop] Fatal error in module file: C:\xampp\htdocs\presta1720\modules\ddservicecms\classes\servicecmsClass.php:60Undefined class constant 'getValue'Content file servicecmsClass.php: <?php /* * 2007-2015 PrestaShop * * NOTICE OF LICENSE * * This source file is subject to the Academic Free License (AFL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/afl-3.0.php * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to [email protected] so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA <[email protected]> * @copyright 2007-2015 PrestaShop SA * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA */ class servicecmsClass extends ObjectModel { /** @var integer servicecms id*/ public $id; /** @var integer servicecms id shop*/ public $id_shop; /** @var string servicecms file name icon*/ public $file_name; /** @var string servicecms text*/ public $text; /** * @see ObjectModel::$definition */ public static $definition = array( 'table' => 'servicecms', 'primary' => 'id_servicecms', 'multilang' => true, 'fields' => array( 'id_shop' => array('type' => self::TYPE_INT, 'validate' => 'isunsignedInt', 'required' => true), 'file_name' => array('type' => self::TYPE_STRING, 'validate' => 'isFileName'), // Lang fields 'text' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'required' => true), ) ); public function copyFromPost() { /* Classical fields */ foreach (Tools::getValue as $key => $value) { if (array_key_exists($key, $this) and $key != 'id_'.$this->table) { $this->{$key} = $value; } } /* Multilingual fields */ if (sizeof($this->fieldsValidateLang)) { $languages = Language::getLanguages(false); foreach ($languages as $language) { foreach ($this->fieldsValidateLang as $field => $validation) { if (Tools::getIsset(Tools::getValue[$field.'_'.(int)($language['id_lang'])])) { $this->{$field}[(int)($language['id_lang'])] = Tools::getValue[$field.'_'.(int)($language['id_lang'])]; } } } } } } 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