您的 OC 版本似乎为 3.0.2.x 或更高版本。
In your $this->data
在事件类中,您注册的事件缺少操作参数。
$this->data[] = array(
'trigger' => $trigger,
'action' => $action, // <-- this must be an Action Object with a method execute()
'priority' => $priority
);
所有事件均通过以下方式注册register()
显式请求将 Action 对象作为参数传递的方法。
由于错误指向“调用未定义的方法 Action::execute()”,我可以假设您的操作类存在问题。
您很可能需要检查以下内容的修改system/engine/action.php
文件在你的system/storage/modifications
.
可能是这个方法execute()
要么丢失,要么以某种方式损坏。
Debug
尝试 var_dump $value 以查看其中有什么:
public function trigger($event, array $args = array()) {
foreach ($this->data as $value) {
//log out the $value before the error to see if the Action object is actually there and see what trigger causes this.
var_dump($value);
if (preg_match('/^' . str_replace(array('\*', '\?'), array('.*', '.'), preg_quote($value['trigger'], '/')) . '/', $event)) {
$result = $value['action']->execute($this->registry, $args);
if (!is_null($result) && !($result instanceof Exception)) {
return $result;
}
}
}
}
希望这可以帮助