Commit c03d1d7d authored by anon's avatar anon Committed by anon

Issue #2856732 by anon: Linking to files, do not use the domain?

parent 15cc6175
......@@ -229,7 +229,7 @@ class EntityMatcher extends ConfigurableMatcherBase {
// Check the access against the defined entity access handler.
/** @var \Drupal\Core\Access\AccessResultInterface $access */
$access = $entity->access('view', $this->currentUser, TRUE);
if ($access->isForbidden()) {
if (!$access->isAllowed()) {
continue;
}
......
......@@ -183,6 +183,7 @@ class FileMatcher extends EntityMatcher {
* entity interface.
*/
protected function buildPath($entity) {
return $entity->url();
/** @var \Drupal\file\FileInterface $entity */
return file_url_transform_relative(file_create_url($entity->getFileUri()));
}
}
......@@ -35,7 +35,7 @@ class UserMatcherTest extends LinkitTestBase {
*/
protected function setUp() {
parent::setUp();
$this->drupalLogin($this->adminUser);
$this->drupalLogin($this->drupalCreateUser(['access user profiles']));
$this->manager = $this->container->get('plugin.manager.linkit.matcher');
$custom_role = $this->drupalCreateRole(array(), 'custom_role', 'custom_role');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment