Skip to content

Commit d086b8b

Browse files
klausifubhy
authored andcommitted
fix(travis): Install missing mysql (#920)
1 parent 0bf46bc commit d086b8b

3 files changed

Lines changed: 12 additions & 1 deletion

File tree

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
language: php
22
sudo: false
3+
dist: bionic
4+
5+
services:
6+
- mysql
37

48
php:
59
- 7.2

src/Plugin/GraphQL/DataProducer/Entity/EntityLoadMultiple.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,10 @@ public function resolve($type, array $ids, $language, array $bundles, ?bool $acc
173173
/* @var $accessResult \Drupal\Core\Access\AccessResultInterface */
174174
$accessResult = $entity->access($accessOperation, $accessUser, TRUE);
175175
$context->addCacheableDependency($accessResult);
176-
if ($accessResult->isForbidden()) {
176+
// We need to call isAllowed() because isForbidden() returns FALSE
177+
// for neutral access results, which is dangerous. Only an explicitly
178+
// allowed result means that the user has access.
179+
if (!$accessResult->isAllowed()) {
177180
unset($entities[$id]);
178181
continue;
179182
}

tests/src/Kernel/DataProducer/EntityMultipleTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ public function testResolveEntityLoadMultiple() {
9292
'type' => $this->node1->getEntityTypeId(),
9393
'bundles' => [$this->node1->bundle(), $this->node2->bundle()],
9494
'ids' => [$this->node1->id(), $this->node2->id(), $this->node3->id()],
95+
// @todo We need to set these default values here to make the access
96+
// handling work. Ideally that should not be needed.
97+
'access' => TRUE,
98+
'access_operation' => 'view',
9599
]);
96100

97101
$nids = array_values(array_map(function (NodeInterface $item) {

0 commit comments

Comments
 (0)