diff --git a/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php b/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php index 8c66dd0..11575a9 100644 --- a/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php +++ b/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php @@ -285,6 +285,23 @@ protected function getNormalizedPatchEntity() { } /** + * Gets the second normalized POST entity. + * + * Entity types can have non-sequential IDs, and in that case the second + * entity created for POST testing needs to be able to specify a different ID. + * + * @see ::testPost + * @see ::getNormalizedPostEntity + * + * @return array + * An array structure as returned by ::getNormalizedPostEntity(). + */ + protected function getSecondNormalizedPostEntity() { + // Return the values of the "parent" method by default. + return $this->getNormalizedPostEntity(); + } + + /** * Gets the normalized POST entity with random values for its unique fields. * * @see ::testPost @@ -765,7 +782,7 @@ public function testPost() { // Try with all of the following request bodies. $unparseable_request_body = '!{>}<'; $parseable_valid_request_body = $this->serializer->encode($this->getNormalizedPostEntity(), static::$format); - $parseable_valid_request_body_2 = $this->serializer->encode($this->getNormalizedPostEntity(), static::$format); + $parseable_valid_request_body_2 = $this->serializer->encode($this->getSecondNormalizedPostEntity(), static::$format); $parseable_invalid_request_body = $this->serializer->encode($this->makeNormalizationInvalid($this->getNormalizedPostEntity(), 'label'), static::$format); $parseable_invalid_request_body_2 = $this->serializer->encode($this->getNormalizedPostEntity() + ['uuid' => [$this->randomMachineName(129)]], static::$format); $parseable_invalid_request_body_3 = $this->serializer->encode($this->getNormalizedPostEntity() + ['field_rest_test' => [['value' => $this->randomString()]]], static::$format); diff --git a/core/modules/workspace/src/WorkspaceManager.php b/core/modules/workspace/src/WorkspaceManager.php index fca0f95..bdba834 100644 --- a/core/modules/workspace/src/WorkspaceManager.php +++ b/core/modules/workspace/src/WorkspaceManager.php @@ -175,7 +175,7 @@ public function setActiveWorkspace(WorkspaceInterface $workspace) { // If the current user doesn't have access to view the workspace, they // shouldn't be allowed to switch to it. if (!$workspace->access('view') && !$workspace->isDefaultWorkspace()) { - $this->logger->error('Denied access to view workspace {workspace}', ['workspace' => $workspace->label()]); + $this->logger->error('Denied access to view workspace %workspace_label', ['%workspace_label' => $workspace->label()]); throw new WorkspaceAccessException('The user does not have permission to view that workspace.'); } diff --git a/core/modules/workspace/workspace.info.yml b/core/modules/workspace/workspace.info.yml index 9599e07..fad98f8 100644 --- a/core/modules/workspace/workspace.info.yml +++ b/core/modules/workspace/workspace.info.yml @@ -5,5 +5,3 @@ version: VERSION core: 8.x package: Core (Experimental) configure: entity.workspace.collection -dependencies: - - user