Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
drupal.org
link
Commits
f835e23e
Commit
f835e23e
authored
Oct 20, 2019
by
Damien McKenna
Browse files
Merge tag '7.x-1.5' into 7.x-1.x
parents
21af7fc7
90a59d39
Changes
1
Hide whitespace changes
Inline
Side-by-side
link.module
View file @
f835e23e
...
...
@@ -366,19 +366,8 @@ function link_field_update($entity_type, $entity, $field, $instance, $langcode,
*/
function
link_field_prepare_view
(
$entity_type
,
$entities
,
$field
,
$instances
,
$langcode
,
&
$items
)
{
foreach
(
$items
as
$entity_id
=>
$entity_items
)
{
$settings
=
$instances
[
$entity_id
][
'settings'
];
$trimTitle
=
trim
(
$settings
[
'title_value'
]);
if
(
empty
(
$entity_items
)
&&
!
empty
(
$trimTitle
)
&&
$settings
[
'title'
]
==
'value'
&&
$settings
[
'url'
]
===
'optional'
)
{
$token_value
=
token_replace
(
$settings
[
'title_value'
],
array
(
$entity_type
=>
$entities
[
$entity_id
]));
$display_title
=
htmlspecialchars_decode
(
$token_value
,
ENT_QUOTES
);
$items
[
$entity_id
][
0
][
'url'
]
=
NULL
;
$items
[
$entity_id
][
0
][
'title'
]
=
$display_title
;
$items
[
$entity_id
][
0
][
'attributes'
]
=
array
();
}
else
{
foreach
(
$entity_items
as
$delta
=>
$value
)
{
_link_sanitize
(
$items
[
$entity_id
][
$delta
],
$delta
,
$field
,
$instances
[
$entity_id
],
$entities
[
$entity_id
]);
}
foreach
(
$entity_items
as
$delta
=>
$value
)
{
_link_sanitize
(
$items
[
$entity_id
][
$delta
],
$delta
,
$field
,
$instances
[
$entity_id
],
$entities
[
$entity_id
]);
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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