ivanson7 Posted May 13, 2020 Share Posted May 13, 2020 Hola a todos a ver si me podeis ayudar, tengo instalado el modulo ps blog y cuando intento crear una categoria me sale este error Exception Symfony\Component\Debug\Exception\ContextErrorException in classes/controller/AdminController.php (line 3870) foreach ($fields as $field => $params) { if (array_key_exists('lang', $params) && $params['lang']) { foreach (Language::getIDs(false) as $id_lang) { if (Tools::isSubmit($field . '_' . (int) $id_lang)) { $object->{$field}[(int) $id_lang] = Tools::getValue($field . '_' . (int) $id_lang); } } } } } AdminControllerCore->copyFromPost(object(Psblogcat), 'psblogcat')in modules/psblog/controllers/admin/AdminPsblogCategories.php (line 155) } else { # validate module $megamenu = new psblogcat(); } $this->copyFromPost($megamenu, $this->table); $megamenu->id_shop = $this->context->shop->id; if ($megamenu->validateFields(false) && $megamenu->validateFieldsLang(false)) { $megamenu->save(); if (isset($_FILES['image']) && isset($_FILES['image']['tmp_name']) && !empty($_FILES['image']['tmp_name'])) { AdminPsblogCategoriesController->postProcess()in classes/controller/Controller.php (line 281) if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className))) { $this->setMedia(); } // postProcess handles ajaxProcess $this->postProcess(); if (!empty($this->redirect_after)) { $this->redirect(); } ControllerCore->run()in classes/Dispatcher.php (line 515) if (isset($params_hook_action_dispatcher)) { Hook::exec('actionDispatcher', $params_hook_action_dispatcher); } // Running controller $controller->run(); // Execute hook dispatcher after if (isset($params_hook_action_dispatcher)) { Hook::exec('actionDispatcherAfter', $params_hook_action_dispatcher); } DispatcherCore->dispatch()in adminp61jvo/index.php (line 97) if (!headers_sent()) { header('Content-Type: text/html; charset=utf-8'); } // Prepare and trigger LEGACY admin dispatcher Dispatcher::getInstance()->dispatch(); } Logs LevelChannelMessage DEBUG06:47:16doctrineSELECT name FROM ps_module WHERE active = 1 WARNING06:47:16translationTranslation not found. WARNING06:47:16translationTranslation not found. WARNING06:47:16translationTranslation not found. WARNING06:47:16translationTranslation not found. WARNING06:47:16translationTranslation not found. WARNING06:47:16translationTranslation not found. WARNING06:47:16translationTranslation not found. INFO06:47:16phpUser Deprecated: AdminMarketing is a deprecated tab since version 1.7.0 and "Default" will be removed in 1.7.1.. Upgrade module using the docs: http://build.prestashop.com/news/how-we-reorganized-main-menu-prestashop-1.7/. DEBUG06:47:16phpWarning: filemtime(): stat failed for /var/www/v2.test1234.es/adminp61jvo/themes/default/css/theme.css WARNING06:47:16translationTranslation not found. WARNING06:47:16translationTranslation not found. WARNING06:47:16translationTranslation not found. DEBUG06:47:16phpWarning: filemtime(): stat failed for /var/www/v2.test1234.es/js/jquery/plugins/jquery.cookie-plugin.js CRITICAL06:47:16phpUncaught Warning: Cannot assign an empty string to a string offset INFO06:47:16phpUser Deprecated: Implementing "Symfony\Component\HttpKernel\DataCollector\DataCollectorInterface" without the "reset()" method is deprecated since Symfony 3.4 and will be unsupported in 4.0 for class "Csa\Bundle\GuzzleBundle\DataCollector\GuzzleCollector". CRITICAL06:47:16requestUncaught PHP Exception Symfony\Component\Debug\Exception\ContextErrorException: "Warning: Cannot assign an empty string to a string offset" at /var/www/v2.test1234.es/classes/controller/AdminController.php line 3870 1 Link to comment Share on other sites More sharing options...
kolmen Posted October 23, 2021 Share Posted October 23, 2021 do you find solution? Link to comment Share on other sites More sharing options...
Genom Posted December 28, 2021 Share Posted December 28, 2021 Hi! It helped me: classes/controller/AdminController.php: ~3844 protected function copyFromPost(&$object, $table) { ... foreach ($fields as $field => $params) { if (array_key_exists('lang', $params) && $params['lang']) { $object->{$field} = []; //add this foreach (Language::getIDs(false) as $id_lang) { if (Tools::isSubmit($field . '_' . (int) $id_lang)) { $object->{$field}[(int) $id_lang] = Tools::getValue($field . '_' . (int) $id_lang); } } } } } 1 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