diff --git a/core/modules/workflows/src/EventSubscriber/ConfigImportSubscriber.php b/core/modules/workflows/src/EventSubscriber/ConfigImportSubscriber.php index f22187f08f..6a0d7defaa 100644 --- a/core/modules/workflows/src/EventSubscriber/ConfigImportSubscriber.php +++ b/core/modules/workflows/src/EventSubscriber/ConfigImportSubscriber.php @@ -67,7 +67,7 @@ public function onConfigImporterValidate(ConfigImporterEvent $event) { } } if ($op === 'delete') { - if ($workflow->getTypePlugin()->workflowHasData($workflow, new CacheableMetadata())) { + if ($workflow->getTypePlugin()->workflowHasData($workflow, new CacheableMetadata())) { $event->getConfigImporter()->logError($this->t('The workflow @workflow_label is being used, and cannot be deleted.', ['@workflow_label' => $workflow->label()])); } } diff --git a/core/modules/workflows/src/WorkflowAccessControlHandler.php b/core/modules/workflows/src/WorkflowAccessControlHandler.php index d09b92a9f4..032117d0c7 100644 --- a/core/modules/workflows/src/WorkflowAccessControlHandler.php +++ b/core/modules/workflows/src/WorkflowAccessControlHandler.php @@ -67,7 +67,7 @@ protected function checkAccess(EntityInterface $entity, $operation, AccountInter ->andIf(AccessResult::allowedIf(!$workflow_type->workflowStateHasData($entity, $workflow_type->getState($state_id), $workflow_has_data_cacheability))) ->addCacheableDependency($entity); } - else if ($operation === 'delete' && $workflow_type->workflowHasData($entity, $workflow_has_data_cacheability)) { + elseif ($operation === 'delete' && $workflow_type->workflowHasData($entity, $workflow_has_data_cacheability)) { $access_result = AccessResult::neutral(); } else { diff --git a/core/modules/workflows/tests/src/Kernel/ConfigImportSubscriberTest.php b/core/modules/workflows/tests/src/Kernel/ConfigImportSubscriberTest.php index dccaebf5ae..63a3596b35 100644 --- a/core/modules/workflows/tests/src/Kernel/ConfigImportSubscriberTest.php +++ b/core/modules/workflows/tests/src/Kernel/ConfigImportSubscriberTest.php @@ -60,16 +60,16 @@ protected function setUp() { */ public function testDeletingStates() { // Removing states without data will succeed, even if the workflow has data. - $this->alterConfigData('workflows.workflow.with_data', function(&$data) { + $this->alterConfigData('workflows.workflow.with_data', function (&$data) { unset($data['type_settings']['states']['no_data']); }); - $this->alterConfigData('workflows.workflow.without_data', function(&$data) { + $this->alterConfigData('workflows.workflow.without_data', function (&$data) { unset($data['type_settings']['states']['no_data']); }); $this->configImporter()->reset()->import(); // Removing a state with data will cause an import exception. - $this->alterConfigData('workflows.workflow.with_data', function(&$data) { + $this->alterConfigData('workflows.workflow.with_data', function (&$data) { unset($data['type_settings']['states']['data']); }); try { diff --git a/core/modules/workflows/tests/src/Kernel/WorkflowAccessControlHandlerTest.php b/core/modules/workflows/tests/src/Kernel/WorkflowAccessControlHandlerTest.php index d2d2b9c01a..d0712d9ea8 100644 --- a/core/modules/workflows/tests/src/Kernel/WorkflowAccessControlHandlerTest.php +++ b/core/modules/workflows/tests/src/Kernel/WorkflowAccessControlHandlerTest.php @@ -258,7 +258,7 @@ public function checkAccessProvider() { 'update', AccessResult::allowed() ->addCacheTags([]) - ->addCacheContexts(['user.permissions']), // @todo, should these be uncacheable? + ->addCacheContexts(['user.permissions']), ['foo' => FALSE], ], ];