PHP Opencart Anylist 模块问题

PHP Opencart Anylist Module issue

有谁知道这是什么问题? 当我在 opencart 中保存或编辑一个新的 anylist 块时,出现此消息:

Notice: Undefined index: module_id in /controller/module/anylist.php on line 16

这是文件的第 16 行:

    if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
                if (!isset($this->request->get['module_id'])) {
                    /*this is the line 16*/
                    $this->model_extension_module->addModule('anylist', array_merge($this->request->post,array('module_id'=>$this->request->get['module_id'])));
                } else {
                    $this->model_extension_module->editModule($this->request->get['module_id'], array_merge($this->request->post,array('module_id'=>$this->request->get['module_id'])));
                }
                $this->session->data['success'] = $this->language->get('text_success');
                $this->response->redirect($this->url->link('extension/module', 'token=' . $this->session->data['token'], 'SSL'));
            }

有人知道问题出在哪里吗?

谢谢。

这对我有用。 您需要替换此代码

if (!isset($this->request->get['module_id'])) {
    /*this is the line 16*/
    $this->model_extension_module->addModule('anylist', array_merge($this->request->post,array('module_id'=>$this->request->get['module_id'])));
} else {
    $this->model_extension_module->editModule($this->request->get['module_id'], array_merge($this->request->post,array('module_id'=>$this->request->get['module_id'])));
}

if (!isset($this->request->get['module_id'])) {
    $this->model_extension_module->addModule('anylist', $this->request->post);
} else {
    $this->model_extension_module->editModule($this->request->get['module_id'], $this->request->post);
}