minor bugfix to contextual block

This commit is contained in:
naomi 2018-05-08 18:30:39 +02:00
parent b8bba0b332
commit 53507dae33
2 changed files with 1 additions and 3 deletions

View File

@ -20,7 +20,6 @@ function opencase_block_access(\Drupal\block\Entity\Block $block, $operation, \D
$routes_where_it_should_be_shown = [ $routes_where_it_should_be_shown = [
'entity.oc_actor.canonical', 'entity.oc_actor.canonical',
'entity.oc_actor.edit_form', 'entity.oc_actor.edit_form',
'entity.oc_actor.add_form',
'view.cases.page_1', 'view.cases.page_1',
'entity.oc_case.canonical', 'entity.oc_case.canonical',
'entity.oc_case.edit_form', 'entity.oc_case.edit_form',

View File

@ -125,8 +125,7 @@ class ContextualMenu extends BlockBase {
$link = Link::fromTextAndUrl(t($case->getName() .": Case Details and Files"), $url)->toString(); $link = Link::fromTextAndUrl(t($case->getName() .": Case Details and Files"), $url)->toString();
$markup = $this->asNavLinks([$link]); $markup = $this->asNavLinks([$link]);
$current_path = \Drupal::service('path.current')->getPath(); $current_path = \Drupal::service('path.current')->getPath();
$query = ['case_id' => $case_id]; return $markup . Utils::generateAddLinks('oc_activity', "Add activity", ['case_id' => $case_id, 'destination' => $current_path]);
return $markup . Utils::generateAddLinks('oc_activity', "Add activity", $query);
} }
/** /**