test errors are caused by wse_menu module and therefore not related to my code
realityloop → created an issue.
Apologies for the commit noise.. Now that all tests are passing for my MR138....
Drupal Link Handling Changes
1. Main Change: Internal Routes for Storage, Aliases for Display
- Before: Links could be entered using alias (e.g.,
/my-page
), which could break if the alias changed (e.g., to/updated-page
). - After: Internal links are stored using Drupal's stable internal route (e.g.,
entity:node/1
), but the UI shows the current alias (e.g.,/my-page
). This prevents broken links. - Why?: Aliases can change (e.g., for SEO), but internal routes stay the same. The change ensures links remain working even if aliases are updated.
- Fragments: Fragments (e.g.,
#section ?query=1
) are preserved in storage and display, but the changes ensure they're appended to the alias in the UI when present.
2. Examples of Creating Links
Internal Link (e.g., to a Node):
- Without Fragment:
- Before: User types
/my-page
in the link field. Stored asinternal:/my-page
. If alias changes to/new-page
, link breaks. - After: User types
/my-page
or selects from autocomplete. Stored asentity:node/1
(internal route). Displayed as/my-page
(alias). If alias changes, link still works.
- Before: User types
- With Fragment:
- Before: User types
/my-page#section
in the link field. Stored asinternal:/my-page#section
. If alias changes to/new-page
, link breaks. - After: User types
/my-page#section
or selects from autocomplete. Stored asentity:node/1#section
(internal route). Displayed as/my-page#section
(alias with fragment). If alias changes, link still works.
- Before: User types
- Autocomplete: Suggestions show the alias (with or without fragment) in the display, but use internal routes internally.
External Link (e.g., to Another Site):
- Without Fragment:
- Before: User types
https://example.com
. Stored ashttps://example.com
. No change in behavior. - After: Same as before—stored and displayed as
https://example.com
. The change doesn't affect external links.
- Before: User types
- With Fragment:
- Before: User types
https://example.com#anchor
. Stored ashttps://example.com#anchor
. - After: Same as before—stored and displayed as
https://example.com#anchor
.
- Before: User types
- Autocomplete: External matcher suggests the URL (with or without fragment) for bare domains.
Relative Link (e.g., to a Custom Path):
- Without Fragment:
- Before: User types
/custom/path
. Stored asinternal:/custom/path
. Works as a relative link. - After: Same as before—stored as
internal:/custom/path
. If it matches an alias, it might convert to an entity link; otherwise, stays relative.
- Before: User types
- With Fragment:
- Before: User types
/custom/path#part
. Stored asinternal:/custom/path#part
. - After: Same as before—stored as
internal:/custom/path#part
. If it matches an alias, it will convert to an entity link; otherwise, stays relative.
- Before: User types
- Autocomplete: If no entity matches, it suggests the path (with or without fragment) as-is.
3. Examples of Editing Links
Internal Link:
- Without Fragment:
- Before: Link stored as
internal:/my-page
. User edits to/updated-page
. Stored asinternal:/updated-page
. If/my-page
was an alias, editing might not update the entity reference. - After: Link stored as
entity:node/1
. User sees/my-page
in the field. If they edit to/updated-page
(new alias for the same node), it resolves back toentity:node/1
. If edited to a non-entity path, it becomesinternal:/updated-page
.
- Before: Link stored as
- With Fragment:
- Before: Link stored as
internal:/my-page#section
. User edits to/updated-page#newsection
. Stored asinternal:/updated-page#newsection
. - After: Link stored as
entity:node/1#section
. User sees/my-page#section
in the field. If they edit to/updated-page#newsection
, it resolves back toentity:node/1#newsection
. If edited to a non-entity path, it becomesinternal:/updated-page#newsection
.
- Before: Link stored as
External Link:
- Without Fragment:
- Before: Link stored as
https://example.com
. User edits tohttps://newexample.com
. Stored ashttps://newexample.com
. - After: Same as before.
- Before: Link stored as
- With Fragment:
- Before: Link stored as
https://example.com#anchor
. User edits tohttps://newexample.com#newanchor
. Stored ashttps://newexample.com#newanchor
. - After: Same as before. Fragments are preserved.
- Before: Link stored as
Relative Link:
- Without Fragment:
- Before: Link stored as
internal:/custom/path
. User edits to/new/path
. Stored asinternal:/new/path
. - After: Same. If the new path resolves to an entity, it converts to
entity:...
; otherwise, stays relative.
- Before: Link stored as
- With Fragment:
- Before: Link stored as
internal:/custom/path#part
. User edits to/new/path#newpart
. Stored asinternal:/new/path#newpart
. - After: Same. If the new path resolves to an entity, it converts to
entity:...
#newpart; otherwise, stays relative with the fragment.
- Before: Link stored as
4. Other Changes in the Commit
- UI Improvements: Updated JS for autocomplete behavior (e.g., better display in CKEditor, including fragments).
- Autocomplete Controller: Added logic to fetch display paths for entities, ensuring aliases (with or without fragments) are shown in suggestions.
- Widget Updates: Enhanced the link field to display aliases (with or without fragments) while storing internal routes.
- Matcher and Substitution: Tweaks to how entity paths are built (e.g., using
path_processing: false
for internal routes,true
for aliases), with fragment handling. - No Breaking Changes: Existing links continue to work; the commit improves reliability without disrupting current setups.
5. Overall Impact
- Pros: Links are more robust (don't break on alias changes). Users see friendly aliases (with or without fragments) in the UI.
- Cons: Slightly more complex internally, but transparent to users.
- Testing Note: The commit includes changes to ensure autocomplete and editing work seamlessly with or without fragments.
Some screengrabs:
Apologies for the commit noise.. Now that all tests are passing for my MR138....
Drupal Link Handling Changes
1. Main Change: Internal Routes for Storage, Aliases for Display
- Before: Links could be entered using alias (e.g.,
/my-page
), which could break if the alias changed (e.g., to/updated-page
). - After: Internal links are stored using Drupal's stable internal route (e.g.,
entity:node/1
), but the UI shows the current alias (e.g.,/my-page
). This prevents broken links. - Why?: Aliases can change (e.g., for SEO), but internal routes stay the same. The change ensures links remain working even if aliases are updated.
- Fragments: Fragments (e.g.,
#section ?query=1
) are preserved in storage and display, but the changes ensure they're appended to the alias in the UI when present.
2. Examples of Creating Links
Internal Link (e.g., to a Node):
- Without Fragment:
- Before: User types
/my-page
in the link field. Stored asinternal:/my-page
. If alias changes to/new-page
, link breaks. - After: User types
/my-page
or selects from autocomplete. Stored asentity:node/1
(internal route). Displayed as/my-page
(alias). If alias changes, link still works.
- Before: User types
- With Fragment:
- Before: User types
/my-page#section
in the link field. Stored asinternal:/my-page#section
. If alias changes to/new-page
, link breaks. - After: User types
/my-page#section
or selects from autocomplete. Stored asentity:node/1#section
(internal route). Displayed as/my-page#section
(alias with fragment). If alias changes, link still works.
- Before: User types
- Autocomplete: Suggestions show the alias (with or without fragment) in the display, but use internal routes internally.
External Link (e.g., to Another Site):
- Without Fragment:
- Before: User types
https://example.com
. Stored ashttps://example.com
. No change in behavior. - After: Same as before—stored and displayed as
https://example.com
. The change doesn't affect external links.
- Before: User types
- With Fragment:
- Before: User types
https://example.com#anchor
. Stored ashttps://example.com#anchor
. - After: Same as before—stored and displayed as
https://example.com#anchor
.
- Before: User types
- Autocomplete: External matcher suggests the URL (with or without fragment) for bare domains.
Relative Link (e.g., to a Custom Path):
- Without Fragment:
- Before: User types
/custom/path
. Stored asinternal:/custom/path
. Works as a relative link. - After: Same as before—stored as
internal:/custom/path
. If it matches an alias, it might convert to an entity link; otherwise, stays relative.
- Before: User types
- With Fragment:
- Before: User types
/custom/path#part
. Stored asinternal:/custom/path#part
. - After: Same as before—stored as
internal:/custom/path#part
. If it matches an alias, it will convert to an entity link; otherwise, stays relative.
- Before: User types
- Autocomplete: If no entity matches, it suggests the path (with or without fragment) as-is.
3. Examples of Editing Links
Internal Link:
- Without Fragment:
- Before: Link stored as
internal:/my-page
. User edits to/updated-page
. Stored asinternal:/updated-page
. If/my-page
was an alias, editing might not update the entity reference. - After: Link stored as
entity:node/1
. User sees/my-page
in the field. If they edit to/updated-page
(new alias for the same node), it resolves back toentity:node/1
. If edited to a non-entity path, it becomesinternal:/updated-page
.
- Before: Link stored as
- With Fragment:
- Before: Link stored as
internal:/my-page#section
. User edits to/updated-page#newsection
. Stored asinternal:/updated-page#newsection
. - After: Link stored as
entity:node/1#section
. User sees/my-page#section
in the field. If they edit to/updated-page#newsection
, it resolves back toentity:node/1#newsection
. If edited to a non-entity path, it becomesinternal:/updated-page#newsection
.
- Before: Link stored as
External Link:
- Without Fragment:
- Before: Link stored as
https://example.com
. User edits tohttps://newexample.com
. Stored ashttps://newexample.com
. - After: Same as before.
- Before: Link stored as
- With Fragment:
- Before: Link stored as
https://example.com#anchor
. User edits tohttps://newexample.com#newanchor
. Stored ashttps://newexample.com#newanchor
. - After: Same as before. Fragments are preserved.
- Before: Link stored as
Relative Link:
- Without Fragment:
- Before: Link stored as
internal:/custom/path
. User edits to/new/path
. Stored asinternal:/new/path
. - After: Same. If the new path resolves to an entity, it converts to
entity:...
; otherwise, stays relative.
- Before: Link stored as
- With Fragment:
- Before: Link stored as
internal:/custom/path#part
. User edits to/new/path#newpart
. Stored asinternal:/new/path#newpart
. - After: Same. If the new path resolves to an entity, it converts to
entity:...
#newpart; otherwise, stays relative with the fragment.
- Before: Link stored as
4. Other Changes in the Commit
- UI Improvements: Updated JS for autocomplete behavior (e.g., better display in CKEditor, including fragments).
- Autocomplete Controller: Added logic to fetch display paths for entities, ensuring aliases (with or without fragments) are shown in suggestions.
- Widget Updates: Enhanced the link field to display aliases (with or without fragments) while storing internal routes.
- Matcher and Substitution: Tweaks to how entity paths are built (e.g., using
path_processing: false
for internal routes,true
for aliases), with fragment handling. - No Breaking Changes: Existing links continue to work; the commit improves reliability without disrupting current setups.
5. Overall Impact
- Pros: Links are more robust (don't break on alias changes). Users see friendly aliases (with or without fragments) in the UI.
- Cons: Slightly more complex internally, but transparent to users.
- Testing Note: The commit includes changes to ensure autocomplete and editing work seamlessly with or without fragments.
MR 138: for 7.x Continue to use internal route so links don’t get broken, but display url alias in linkit widget and CKeditor when present.
realityloop → made their first commit to this issue’s fork.
@mark_fullmer
thanks for your feedback. May I ask what you would accept?
I believe it makes sense to store the internal route, however for presentation to users I think friendly URL and title are better, would you accept something that stored the internal route, but when loading form looked up and displayed the friendly URL alias?
-so workflow would be seatch by title, friendly alias displayed in field, but internal route stored internally
-when editing a link it would show the friendly route based on lookup of the internal route.
I think this should work oin both CKeditor and linkit fields..?
I have implemented title display on the initial link popup as per this image in my MR
realityloop → created an issue.
Sohail just pushed fix for that error as I was getting it as well.
realityloop → made their first commit to this issue’s fork.
14 days has now passed.
Commenting to confirm my continuing interest to maintain this module as requested above.
Current maintainer has not responded.
rerolled for 1.2.x
please re-open if still relevant
realityloop → changed the visibility of the branch 3539681-add-gitlab-ci to hidden.
realityloop → created an issue.
Please re-open if still relevant
we shouldn't remove support for earlier versions of Drupal unless there are breaking changes
realityloop → made their first commit to this issue’s fork.
Believe #21 still may need to be addressed
MR 92 was for 3.x
late but yep
Current maintainer has contact form disabled on their profile
realityloop → created an issue.
realityloop → created an issue.
realityloop → changed the visibility of the branch drupal11 to hidden.
realityloop → made their first commit to this issue’s fork.
realityloop → changed the visibility of the branch 2.x to hidden.
realityloop → made their first commit to this issue’s fork.
@DieterHolvoet Fixed it.
@DieterHolvoet I accidentally force pushed over your MR9 with 3.0.x version of this work, hopefully you can force push your variant back to MR9?
The automated fixes was missing a composer file, I've added that in MR6, and can confirm this is working for me on Drupal 11.2.2.
How I installed it in my project, added the following to my composer file:
"repositories": {
"drupal": {
"type": "composer",
"url": "https://packages.drupal.org/8",
"exclude": [
"drupal/unpublished_nodes_redirect"
]
"drupal/unpublished_nodes_redirect": {
"type": "git",
"url": "https://git.drupalcode.org/issue/unpublished_nodes_redirect-3435226.git"
}
},
"require": {
then ran:
composer require drupal/unpublished_nodes_redirect:dev-3435226-drupal11
realityloop → made their first commit to this issue’s fork.
lostcarpark → credited realityloop → .
rachel_norfolk → credited realityloop → .
realityloop → created an issue.
hestenet → credited realityloop → .
hestenet → credited realityloop → .
@gold That info was there but got removed in this edit https://www.drupal.org/node/3168194/revisions/view/13931075/13960101 →
mradcliffe → credited realityloop → .
realityloop → made their first commit to this issue’s fork.
fubarhouse → credited realityloop → .
realityloop → made their first commit to this issue’s fork.
realityloop → made their first commit to this issue’s fork.
Screenshot of settings form after this change, Notification email section is collapsed by default.
realityloop → changed the visibility of the branch 3514926-aloow-editing-of to hidden.
realityloop → created an issue. See original summary → .
If you have a case insensitive filesystem (for example for macOS) execute the following
mradcliffe → credited realityloop → .
update instructions for adding additional projects on simplytest.me
not possible to link to in page title ancors, links removed from table