Skip to content

Commit

Permalink
Plugin API: Fix action handlers after registering also a task
Browse files Browse the repository at this point in the history
  • Loading branch information
alecpl committed Mar 29, 2024
1 parent 8133acb commit 337e906
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions program/lib/Roundcube/rcube_plugin_api.php
Original file line number Diff line number Diff line change
Expand Up @@ -545,9 +545,13 @@ public function register_action($action, $owner, $callback, $task = null)
*/
public function exec_action($action)
{
if (isset($this->actions[$action])) {
$rcmail = rcmail::get_instance();

if (isset($this->actions[$rcmail->task . '.' . $action])) {
call_user_func($this->actions[$rcmail->task . '.' . $action]);
} elseif (isset($this->actions[$action])) {
call_user_func($this->actions[$action]);
} elseif (rcmail::get_instance()->action != 'refresh') {
} elseif ($rcmail->action != 'refresh') {
rcube::raise_error([
'code' => 524, 'file' => __FILE__, 'line' => __LINE__,
'message' => "No handler found for action {$action}",
Expand Down

0 comments on commit 337e906

Please sign in to comment.