officerat Posted August 26, 2022 Posted August 26, 2022 array_key_exists(): Argument #2 ($array) must be of type array, reinsuranceClass given in file /config/www/modules/blockreinsurance/reinsuranceClass.php at line 60 Source file: /config/www/modules/blockreinsurance/reinsuranceClass.php 41: /** 42: * @see ObjectModel::$definition 43: */ 44: public static $definition = array( 45: 'table' => 'reinsurance', 46: 'primary' => 'id_reinsurance', 47: 'multilang' => true, 48: 'fields' => array( 49: 'id_shop' => array('type' => self::TYPE_INT, 'validate' => 'isunsignedInt', 'required' => true), 50: 'file_name' => array('type' => self::TYPE_STRING, 'validate' => 'isFileName'), 51: // Lang fields 52: 'text' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'required' => true), 53: ) 54: ); 55: 56: public function copyFromPost() 57: { 58: /* Classical fields */ 59: foreach ($_POST AS $key => $value) 60: if (array_key_exists($key, $this) AND $key != 'id_'.$this->table) 61: $this->{$key} = $value; 62: 63: /* Multilingual fields */ 64: if (sizeof($this->fieldsValidateLang)) 65: { 66: $languages = Language::getLanguages(false); 67: foreach ($languages AS $language) 68: foreach ($this->fieldsValidateLang AS $field => $validation) 69: if (isset($_POST[$field.'_'.(int)($language['id_lang'])])) 70: $this->{$field}[(int)($language['id_lang'])] = $_POST[$field.'_'.(int)($language['id_lang'])]; Stack trace 1. modules/blockreinsurance/blockreinsurance.php:145 source reinsuranceClass->copyFromPost() 2. controllers/admin/AdminModulesController.php:1660 source Blockreinsurance->getContent() 3. controllers/admin/AdminModulesController.php:1523 source AdminModulesControllerCore->postProcessCallback() 4. classes/controller/Controller.php:204 source AdminModulesControllerCore->postProcess() 5. classes/Dispatcher.php:861 source ControllerCore->run() 6. admin5275bvaue/index.php:58 source DispatcherCore->dispatch() PHP version: unknown. Code revision: unknown build for PHP unknown
officerat Posted August 26, 2022 Author Posted August 26, 2022 (edited) 1 minute ago, officerat said: 60: if (array_key_exists($key, $this) AND $key != 'id_'.$this->table) Is something wrong with this line? Edited August 26, 2022 by officerat
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