Skip to content
Snippets Groups Projects
Commit 81f798db authored by Brian Canini's avatar Brian Canini
Browse files

Updating drupal/link_attributes (1.10.0 => 1.11.0)

parent 6f5caa4d
No related branches found
No related tags found
No related merge requests found
......@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "8bbf1b75a83436fa7654bf0208a40f2d",
"content-hash": "31bc539ebf7d9723cb8e89d000701658",
"packages": [
{
"name": "alchemy/zippy",
......@@ -5457,29 +5457,26 @@
},
{
"name": "drupal/link_attributes",
"version": "1.10.0",
"version": "1.11.0",
"source": {
"type": "git",
"url": "https://git.drupalcode.org/project/link_attributes.git",
"reference": "8.x-1.10"
"reference": "8.x-1.11"
},
"dist": {
"type": "zip",
"url": "https://ftp.drupal.org/files/projects/link_attributes-8.x-1.10.zip",
"reference": "8.x-1.10",
"shasum": "3df450b83a05911575aaf9b234a3b43833d3c1c2"
"url": "https://ftp.drupal.org/files/projects/link_attributes-8.x-1.11.zip",
"reference": "8.x-1.11",
"shasum": "ca8c7e71c38350e3784dc3d1f779d700f55df818"
},
"require": {
"drupal/core": "^8 || ^9"
},
"type": "drupal-module",
"extra": {
"branch-alias": {
"dev-1.x": "1.x-dev"
},
"drupal": {
"version": "8.x-1.10",
"datestamp": "1580259496",
"version": "8.x-1.11",
"datestamp": "1598323550",
"security-coverage": {
"status": "covered",
"message": "Covered by Drupal's security advisory policy"
......
......@@ -5621,30 +5621,27 @@
},
{
"name": "drupal/link_attributes",
"version": "1.10.0",
"version_normalized": "1.10.0.0",
"version": "1.11.0",
"version_normalized": "1.11.0.0",
"source": {
"type": "git",
"url": "https://git.drupalcode.org/project/link_attributes.git",
"reference": "8.x-1.10"
"reference": "8.x-1.11"
},
"dist": {
"type": "zip",
"url": "https://ftp.drupal.org/files/projects/link_attributes-8.x-1.10.zip",
"reference": "8.x-1.10",
"shasum": "3df450b83a05911575aaf9b234a3b43833d3c1c2"
"url": "https://ftp.drupal.org/files/projects/link_attributes-8.x-1.11.zip",
"reference": "8.x-1.11",
"shasum": "ca8c7e71c38350e3784dc3d1f779d700f55df818"
},
"require": {
"drupal/core": "^8 || ^9"
},
"type": "drupal-module",
"extra": {
"branch-alias": {
"dev-1.x": "1.x-dev"
},
"drupal": {
"version": "8.x-1.10",
"datestamp": "1580259496",
"version": "8.x-1.11",
"datestamp": "1598323550",
"security-coverage": {
"status": "covered",
"message": "Covered by Drupal's security advisory policy"
......
......@@ -7,7 +7,7 @@ dependencies:
- drupal:link
- drupal:system (>=8.4)
# Information added by Drupal.org packaging script on 2020-01-29
version: '8.x-1.10'
# Information added by Drupal.org packaging script on 2020-08-25
version: '8.x-1.11'
project: 'link_attributes'
datestamp: 1580259499
datestamp: 1598323551
......@@ -88,8 +88,6 @@ public static function defaultSettings() {
*/
public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) {
$element = parent::formElement($items, $delta, $element, $form, $form_state);
// Add each of the enabled attributes.
// @todo move this to plugins that nominate form and label.
$item = $items[$delta];
$options = $item->get('options')->getValue();
......@@ -104,6 +102,10 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen
foreach (array_keys(array_filter($this->getSetting('enabled_attributes'))) as $attribute) {
if (isset($plugin_definitions[$attribute])) {
foreach ($plugin_definitions[$attribute] as $property => $value) {
if ($property === 'id') {
// Don't set ID.
continue;
}
$element['options']['attributes'][$attribute]['#' . $property] = $value;
}
......
......@@ -6,7 +6,7 @@ core_version_requirement: ^8 || ^9
dependencies:
- link_attributes:link_attributes
# Information added by Drupal.org packaging script on 2020-01-29
version: '8.x-1.10'
# Information added by Drupal.org packaging script on 2020-08-25
version: '8.x-1.11'
project: 'link_attributes'
datestamp: 1580259499
datestamp: 1598323551
......@@ -103,8 +103,9 @@ public function testWidget() {
// Target attribute.
$attribute_target = 'field_' . $field_name . '[0][options][attributes][target]';
$web_assert->fieldExists($attribute_target);
$target = $web_assert->fieldExists($attribute_target);
$web_assert->fieldValueEquals($attribute_target, '_blank');
$this->assertNotEquals('target', $target->getAttribute('id'));
\Drupal::state()->set('link_attributes_test_alterinfo.hook_link_attributes_plugin_alter', FALSE);
\Drupal::service('plugin.manager.link_attributes')->clearCachedDefinitions();
......@@ -118,7 +119,7 @@ public function testWidget() {
'field_' . $field_name . '[1][uri]' => '<front>',
'field_' . $field_name . '[1][options][attributes][class]' => 'class-three class-four',
];
$this->drupalPostForm($add_path, $edit, t('Save'));
$this->drupalPostForm($add_path, $edit, 'Save');
$node = $this->drupalGetNodeByTitle($edit['title[0][value]']);
// Load the field values.
......@@ -176,7 +177,7 @@ public function testWidgetWithoutAttributes() {
'field_' . $field_name . '[0][title]' => 'Link One',
'field_' . $field_name . '[0][uri]' => '<front>',
];
$this->drupalPostForm($add_path, $edit, t('Save'));
$this->drupalPostForm($add_path, $edit, 'Save');
$node = $this->drupalGetNodeByTitle($edit['title[0][value]']);
$this->drupalGet($node->toUrl()->toString());
$web_assert->linkExists('Link One');
......
......@@ -52,7 +52,7 @@ public function testMenuLinkAdmin() {
// This is enough to check the fields are there.
'link[0][options][attributes][target]' => '_blank',
'link[0][options][attributes][class]' => 'menu__link--really_special menu__link--another-class',
], t('Save'));
], 'Save');
$this->drupalGet('user');
$page = $this->getSession()->getPage();
// The link should exist and contain the required attributes.
......@@ -88,7 +88,7 @@ public function testMenuLinkAdmin() {
'link[0][uri]' => '<front>',
'link[0][options][attributes][target]' => '',
'link[0][options][attributes][rel]' => 'author',
], t('Save'));
], 'Save');
$this->drupalGet('user');
$page = $this->getSession()->getPage();
// The link should exist and contain the set rel attribute.
......
......@@ -38,7 +38,7 @@ public function testLinkAttributesManagerInfoAlter() {
$linkAttributesManager->clearCachedDefinitions();
$definition = $linkAttributesManager->getDefinitions();
$this->assertTrue($definition['class']['type'] == 'select', 'After altering the plugin definition the class attribute is a select.');
$this->assertTrue(isset($definition['class']['options']['button']), 'After altering the plugin definition the class attribute has a "button" option.');
$this->assertArrayHasKey('button', $definition['class']['options']);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment