Commit 2889412d authored by mxh's avatar mxh
Browse files

Issue #3303735 by mxh: Show delete operation link only when a component has no successors

parent 0eb99c14
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -219,7 +219,7 @@ class EcaForm extends EntityForm {
              'weight' => 10,
            ];
          }
          if ($eca->access('delete')) {
          if ($eca->access('delete') && empty($config_array['successors'])) {
            $operations['delete'] = [
              'title' => $this->t('Delete'),
              'url' => Url::fromRoute("eca_cm.event.delete", [
@@ -319,7 +319,7 @@ class EcaForm extends EntityForm {
                'weight' => 10,
              ];
            }
            if ($eca->access('delete') && !EcaCm::configKeyIsUsed($eca, $id, 'condition')) {
            if ($eca->access('delete') && !EcaCm::configKeyIsUsed($eca, $id, 'condition') && empty($config_array['successors'])) {
              $operations['delete'] = [
                'title' => $this->t('Delete'),
                'url' => Url::fromRoute("eca_cm.condition.delete", [
@@ -428,7 +428,7 @@ class EcaForm extends EntityForm {
                'weight' => 10,
              ];
            }
            if ($eca->access('delete') && !EcaCm::configKeyIsUsed($eca, $id, 'action')) {
            if ($eca->access('delete') && !EcaCm::configKeyIsUsed($eca, $id, 'action') && empty($config_array['successors'])) {
              $operations['delete'] = [
                'title' => $this->t('Delete'),
                'url' => Url::fromRoute("eca_cm.action.delete", [
+1 −1
Original line number Diff line number Diff line
@@ -471,7 +471,7 @@ abstract class EcaPluginForm implements FormInterface, ContainerInjectionInterfa
      '#button_type' => 'primary',
      '#weight' => 10,
    ];
    if (!$plugin_is_new && !$is_used) {
    if (!$plugin_is_new && !$is_used && empty($config_array['successors'])) {
      $form['actions']['delete'] = [
        '#type' => 'submit',
        '#value' => $this->t('Delete'),