diff --git a/lib/outputcomponents.php b/lib/outputcomponents.php index 872d573c6ea..6d609154749 100644 --- a/lib/outputcomponents.php +++ b/lib/outputcomponents.php @@ -308,7 +308,7 @@ class action_link implements renderable { public function __construct(moodle_url $url, $text, component_action $action=null, array $attributes=null) { $this->url = clone($url); $this->text = $text; - if ($actions) { + if ($action) { $this->add_action($action); } } diff --git a/lib/outputrenderers.php b/lib/outputrenderers.php index 09c0edde93d..4eee2af0a84 100644 --- a/lib/outputrenderers.php +++ b/lib/outputrenderers.php @@ -932,7 +932,7 @@ class core_renderer extends renderer_base { } $link = new action_link($url, $text, $action, $attributes); - $this->render($link); + return $this->render($link); } /** @@ -954,7 +954,7 @@ class core_renderer extends renderer_base { $attributes['href'] = $link->url; if ($link->actions) { - if (empty($attributes[$id])) { + if (empty($attributes['id'])) { $id = html_writer::random_id('action_link'); $attributes['id'] = $id; } else {