[BUGFIX] Consider default recipients in preselection check 56/61056/2
authorHannes Bochmann <hannes.bochmann@dmk-ebusiness.com>
Thu, 13 Jun 2019 13:00:21 +0000 (15:00 +0200)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Fri, 5 Jul 2019 16:26:53 +0000 (18:26 +0200)
When checking if a workspace stage has a preselection the
default recipients need to be considered, too.
Consequently the default recipients field in the TCA needs
to stay visible if the option to show the notification dialog
is unchecked.

Resolves: #82475
Releases: master, 9.5, 8.7
Change-Id: I7edb257c803a519a06e8fc65fe2b5cb03d3ce7ff
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/61056
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Benni Mack <benni@typo3.org>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Benni Mack <benni@typo3.org>
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
typo3/sysext/workspaces/Classes/Domain/Record/StageRecord.php
typo3/sysext/workspaces/Configuration/TCA/sys_workspace.php
typo3/sysext/workspaces/Configuration/TCA/sys_workspace_stage.php

index 6b7cec4..31a2e4f 100644 (file)
@@ -268,6 +268,14 @@ class StageRecord extends AbstractRecord
     /**
      * @return bool
      */
+    public function hasDefaultRecipients(): bool
+    {
+        return $this->record['notification_defaults'] !== '';
+    }
+
+    /**
+     * @return bool
+     */
     public function hasPreselection()
     {
         return
@@ -275,6 +283,7 @@ class StageRecord extends AbstractRecord
             || $this->areMembersPreselected()
             || $this->areEditorsPreselected()
             || $this->areResponsiblePersonsPreselected()
+            || $this->hasDefaultRecipients()
         ;
     }
 
index eb17fc9..04deb1c 100644 (file)
@@ -165,7 +165,6 @@ return [
         ],
         'edit_notification_defaults' => [
             'label' => 'LLL:EXT:workspaces/Resources/Private/Language/locallang_db.xlf:sys_workspace_stage.notification_defaults',
-            'displayCond' => 'FIELD:edit_allow_notificaton_settings:BIT:1',
             'config' => [
                 'type' => 'group',
                 'internal_type' => 'db',
@@ -203,7 +202,6 @@ return [
         ],
         'publish_notification_defaults' => [
             'label' => 'LLL:EXT:workspaces/Resources/Private/Language/locallang_db.xlf:sys_workspace_stage.notification_defaults',
-            'displayCond' => 'FIELD:publish_allow_notificaton_settings:BIT:1',
             'config' => [
                 'type' => 'group',
                 'internal_type' => 'db',
@@ -241,7 +239,6 @@ return [
         ],
         'execute_notification_defaults' => [
             'label' => 'LLL:EXT:workspaces/Resources/Private/Language/locallang_db.xlf:sys_workspace_stage.notification_defaults',
-            'displayCond' => 'FIELD:execute_allow_notificaton_settings:BIT:1',
             'config' => [
                 'type' => 'group',
                 'internal_type' => 'db',
index da6a53a..6941777 100644 (file)
@@ -58,7 +58,6 @@ return [
         ],
         'notification_defaults' => [
             'label' => 'LLL:EXT:workspaces/Resources/Private/Language/locallang_db.xlf:sys_workspace_stage.notification_defaults',
-            'displayCond' => 'FIELD:allow_notificaton_settings:BIT:1',
             'config' => [
                 'type' => 'group',
                 'internal_type' => 'db',