summaryrefslogtreecommitdiffstats
path: root/core/modules/rest/src/Plugin/rest/resource/EntityResource.php
diff options
context:
space:
mode:
authorAlex Pott2015-06-05 21:46:55 +0100
committerAlex Pott2015-06-05 21:46:55 +0100
commit068edfc14e1c23ad83388c350669becf508bdf50 (patch)
treecd71c559f15c4aa25acbb2e8cd557ef790e2dd46 /core/modules/rest/src/Plugin/rest/resource/EntityResource.php
parent700158c93b5cbfd0f532edd51be025fe2882b66d (diff)
Issue #2395831 by dawehner, fago, martin107, cafuego, YesCT, plach, jibran, larowlan, Wim Leers, effulgentsia, klausi: Entity forms skip validation of fields that are not in the EntityFormDisplay
Diffstat (limited to 'core/modules/rest/src/Plugin/rest/resource/EntityResource.php')
-rw-r--r--core/modules/rest/src/Plugin/rest/resource/EntityResource.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/modules/rest/src/Plugin/rest/resource/EntityResource.php b/core/modules/rest/src/Plugin/rest/resource/EntityResource.php
index f7a0fa4..7ed3ff6 100644
--- a/core/modules/rest/src/Plugin/rest/resource/EntityResource.php
+++ b/core/modules/rest/src/Plugin/rest/resource/EntityResource.php
@@ -209,6 +209,11 @@ class EntityResource extends ResourceBase {
*/
protected function validate(EntityInterface $entity) {
$violations = $entity->validate();
+
+ // Remove violations of inaccessible fields as they cannot stem from our
+ // changes.
+ $violations->filterByFieldAccess();
+
if (count($violations) > 0) {
$message = "Unprocessable Entity: validation failed.\n";
foreach ($violations as $violation) {