- π―π΅Japan tyler36 Osaka
Tested on Drupal `10.0.3`
## Test
1. Added internal-only Link field to 'Article' node.
2. Added external-only Link field to 'Article' node.
3. Created new article with internal & external links.## Other
https://www.drupal.org/project/extlink β will also need updating to remove the `jQuery` reference from the first paragraph.
- Status changed to Needs work
over 1 year ago 4:32pm 2 February 2024 - π©πͺGermany Anybody Porta Westfalica
Thanks! Conflicts need to be resolved!
- Status changed to Needs review
over 1 year ago 9:10pm 4 February 2024 - π¦πΉAustria granik Vienna
@Anybody, thanks. Just rebased, but would be ok if you test your new mailto feature again after my rebase.
- Status changed to Needs work
about 1 year ago 7:00pm 29 February 2024 - Status changed to Needs review
about 1 year ago 3:17pm 5 March 2024 - Status changed to Needs work
11 months ago 2:13am 26 June 2024 - πΊπΈUnited States smustgrave
Would like to include with 2.0.x but appears to breaking a number of tests.
- πΊπΈUnited States smustgrave
Woo got main pipeline all green so any change should be legit issues.
The rebase had lots of commits, because I merged once instead of rebasing prior to that.
I fixed almost all of the eslint issues. There are a few that I don't know if they should be ignored or changed.
- πΊπΈUnited States smustgrave
Wouldn't worry about those, but the test failures could be showing an issue.
Both failing tests are because it's not finding the external settings file.
It has
$this->drupalLogin($this->adminUser); $this->drupalGet(self::EXTLINK_ADMIN_PATH); $this->assertSession()->checkboxNotChecked('extlink_exclude_admin_routes'); $this->assertSession()->responseContains('/extlink/js/extlink.js'); // Disable Extlink on admin routes. $this->drupalGet(self::EXTLINK_ADMIN_PATH); $this->submitForm(['extlink_exclude_admin_routes' => TRUE], 'Save configuration'); $this->assertSession()->responseNotContains('/extlink/js/extlink.js');
Should it be this instead, with
/extlink/settings.js
?$this->drupalLogin($this->adminUser); $this->drupalGet(self::EXTLINK_ADMIN_PATH); $this->assertSession()->checkboxNotChecked('extlink_exclude_admin_routes'); $this->assertSession()->responseContains('/extlink/settings.js'); // Disable Extlink on admin routes. $this->drupalGet(self::EXTLINK_ADMIN_PATH); $this->submitForm(['extlink_exclude_admin_routes' => TRUE], 'Save configuration'); $this->assertSession()->responseNotContains('/extlink/settings.js');
- πΊπΈUnited States smustgrave
Ah that took me forever to figure out yesterday. So the test may need to be updated to check the host. Gitlab running with localhost/web was causing all tests to fail before.
I think this will fix the tests. The functionality with the external settings is actually working when I run it. It's just checking for the wrong string in the response.
- Status changed to Needs review
11 months ago 4:48pm 26 June 2024 - Status changed to Needs work
11 months ago 5:28pm 26 June 2024 - πΊπΈUnited States smustgrave
Reverted the changes to the test as don't think we should update those. If the jquery removal is correct then nothing should break. So think maybe the js changes around the nofollow/referrer needs some work.
- πΊπΈUnited States smustgrave
Don't have the why yet but appears to be when the link has a target already set that the js fails to add a rel attribute
- Status changed to Needs review
11 months ago 5:50pm 26 June 2024 - πΊπΈUnited States smustgrave
So I moved the filter part of the js down after the rel is added. Wasn't needed before but tests appear green. Thoughts?
- Status changed to Needs work
11 months ago 6:19pm 26 June 2024 It's better, but I don't think it's quite right. The
externalLinks
variable is filtered down, meaning that later whennoreferrer
is added, it won't be added to links that already had thetarget
attribute set, even if thetarget
is_blank
. Is that the desired functionality? The form setting says this:A link that specifies target='_self' will not be changed to target='_blank'.
My understanding of the "no override" setting was that it shouldn't override the
target
attribute, but that thenofollow
andnoreferrer
should still be set on the link.Personally, I think this
// Apply the target attribute to all links. externalLinks = externalLinks.filter((link) => { // Filter out links with target set if option specified. return !(drupalSettings.data.extlink.extTargetNoOverride && link.matches('a[target]')); }); // Add target attr to open link in a new tab. externalLinks.forEach((link, i) => { externalLinks[i].setAttribute('target', '_blank'); });
Should be modified so that
externalLinks
is not changed. Something like this:// Add target attr to open link in a new tab if not set. externalLinks.forEach((link, i) => { if (!(drupalSettings.data.extlink.extTargetNoOverride && link.matches('a[target]'))) { externalLinks[i].setAttribute('target', '_blank'); } });
- πΊπΈUnited States smustgrave
Applied suggestion but have to run. If it works and we are happy I can merge this evening.
- Status changed to Needs review
11 months ago 8:17pm 26 June 2024 - Status changed to RTBC
11 months ago 5:07pm 27 June 2024 Looks good to me. Do we need to add a test to cover that
noreferrer
is added to links with a target attribute already set?-
smustgrave β
committed 3497129c on 2.0.x
Issue #3238995 by solideogloria, smustgrave, granik, tyler36: Remove...
-
smustgrave β
committed 3497129c on 2.0.x
- Status changed to Fixed
10 months ago 1:03pm 28 June 2024 - πΊπΈUnited States smustgrave
Think we are probably good.
Down to 2 issue so will plan a beta1 release in the next few days.
Automatically closed - issue fixed for 2 weeks with no activity.