Skip to content

Commit

Permalink
Merge pull request #2465 from ec-europa/nept-2392
Browse files Browse the repository at this point in the history
NEPT-2392: Port link patch to 2.4
  • Loading branch information
Fefaine authored Apr 12, 2019
2 parents 4e389bf + 1aba680 commit e7b89e9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions resources/multisite_drupal_standard.make
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,8 @@ projects[libraries][version] = "2.3"

projects[link][subdir] = "contrib"
projects[link][version] = "1.4"
; https://webgate.ec.europa.eu/CITnet/jira/browse/NEPT-2251
projects[link][patch][] = patches/nept-2251-link-SA-CONTRIB-2019-020.patch

projects[linkchecker][subdir] = "contrib"
projects[linkchecker][version] = "1.2"
Expand Down
18 changes: 18 additions & 0 deletions resources/patches/nept-2251-link-SA-CONTRIB-2019-020.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
--- link.module 2019-02-20 21:18:42.621974792 +0000
+++ link.module 2019-02-20 21:19:16.553471657 +0000
@@ -276,6 +276,15 @@
_link_validate($items[$delta], $delta, $field, $entity, $instance, $langcode, $optional_field_found, $errors);
}
}
+ foreach ($items as $delta => $value) {
+ if (isset($value['attributes']) && is_string($value['attributes'])) {
+ $errors[$field['field_name']][$langcode][$delta][] = array(
+ 'error' => 'link_required',
+ 'message' => t('String values are not acceptable for attributes.'),
+ 'error_element' => array('url' => TRUE, 'title' => FALSE),
+ );
+ }
+ }

if ($instance['settings']['url'] === 'optional' && $instance['settings']['title'] === 'optional' && $instance['required'] && !$optional_field_found) {
$errors[$field['field_name']][$langcode][0][] = array(

0 comments on commit e7b89e9

Please sign in to comment.