From 53507dae33a136de374fffad47c164fbe54105e7 Mon Sep 17 00:00:00 2001 From: naomi Date: Tue, 8 May 2018 18:30:39 +0200 Subject: [PATCH] minor bugfix to contextual block --- opencase.module | 1 - src/Plugin/Block/ContextualMenu.php | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/opencase.module b/opencase.module index 1d0a6e2..faee238 100644 --- a/opencase.module +++ b/opencase.module @@ -20,7 +20,6 @@ function opencase_block_access(\Drupal\block\Entity\Block $block, $operation, \D $routes_where_it_should_be_shown = [ 'entity.oc_actor.canonical', 'entity.oc_actor.edit_form', - 'entity.oc_actor.add_form', 'view.cases.page_1', 'entity.oc_case.canonical', 'entity.oc_case.edit_form', diff --git a/src/Plugin/Block/ContextualMenu.php b/src/Plugin/Block/ContextualMenu.php index 27b23e8..3b71a09 100644 --- a/src/Plugin/Block/ContextualMenu.php +++ b/src/Plugin/Block/ContextualMenu.php @@ -125,8 +125,7 @@ class ContextualMenu extends BlockBase { $link = Link::fromTextAndUrl(t($case->getName() .": Case Details and Files"), $url)->toString(); $markup = $this->asNavLinks([$link]); $current_path = \Drupal::service('path.current')->getPath(); - $query = ['case_id' => $case_id]; - return $markup . Utils::generateAddLinks('oc_activity', "Add activity", $query); + return $markup . Utils::generateAddLinks('oc_activity', "Add activity", ['case_id' => $case_id, 'destination' => $current_path]); } /**