Created
May 2, 2014 16:38
-
-
Save EclipseGc/6940120636b1d22af79b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/core/modules/rest/lib/Drupal/rest/Plugin/rest/resource/.EntityResource.php.swp b/core/modules/rest/lib/Drupal/rest/Plugin/rest/resource/.EntityResource.php.swp | |
deleted file mode 100644 | |
index efbc9bd..0000000 | |
Binary files a/core/modules/rest/lib/Drupal/rest/Plugin/rest/resource/.EntityResource.php.swp and /dev/null differ | |
diff --git a/core/modules/rest/lib/Drupal/rest/Plugin/rest/resource/EntityResource.php b/core/modules/rest/lib/Drupal/rest/Plugin/rest/resource/EntityResource.php | |
index 9b3c792..f373371 100644 | |
--- a/core/modules/rest/lib/Drupal/rest/Plugin/rest/resource/EntityResource.php | |
+++ b/core/modules/rest/lib/Drupal/rest/Plugin/rest/resource/EntityResource.php | |
@@ -9,6 +9,7 @@ | |
use Drupal\Core\Entity\EntityInterface; | |
use Drupal\Core\Entity\EntityStorageException; | |
+use Drupal\Core\Field\FieldItemListInterface; | |
use Drupal\rest\Plugin\ResourceBase; | |
use Drupal\rest\ResourceResponse; | |
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; | |
@@ -47,7 +48,7 @@ public function get(EntityInterface $entity) { | |
throw new AccessDeniedHttpException(); | |
} | |
foreach ($entity as $field_name => $field) { | |
- if (!$field->access('view')) { | |
+ if ($field instanceof FieldItemListInterface && !$field->access('view')) { | |
unset($entity->{$field_name}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment