Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Issue forks
linkit-2886455
Commits
c03d1d7d
Commit
c03d1d7d
authored
Mar 21, 2017
by
Emil Stjerneman
Committed by
Emil Stjerneman
Mar 21, 2017
Browse files
Issue
#2856732
by anon: Linking to files, do not use the domain?
parent
15cc6175
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/Plugin/Linkit/Matcher/EntityMatcher.php
View file @
c03d1d7d
...
...
@@ -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
->
is
Forbidden
())
{
if
(
!
$access
->
is
Allowed
())
{
continue
;
}
...
...
src/Plugin/Linkit/Matcher/FileMatcher.php
View file @
c03d1d7d
...
...
@@ -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
()));
}
}
src/Tests/Matchers/UserMatcherTest.php
View file @
c03d1d7d
...
...
@@ -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'
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment