Account created on 28 April 2007, over 18 years ago
#

Merge Requests

More

Recent comments

🇦🇺Australia realityloop

test errors are caused by wse_menu module and therefore not related to my code

🇦🇺Australia realityloop

realityloop created an issue.

🇦🇺Australia realityloop

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 as internal:/my-page. If alias changes to /new-page, link breaks.
    • After: User types /my-page or selects from autocomplete. Stored as entity:node/1 (internal route). Displayed as /my-page (alias). If alias changes, link still works.
  • With Fragment:
    • Before: User types /my-page#section in the link field. Stored as internal:/my-page#section. If alias changes to /new-page, link breaks.
    • After: User types /my-page#section or selects from autocomplete. Stored as entity:node/1#section (internal route). Displayed as /my-page#section (alias with fragment). If alias changes, link still works.
  • 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 as https://example.com. No change in behavior.
    • After: Same as before—stored and displayed as https://example.com. The change doesn't affect external links.
  • With Fragment:
    • Before: User types https://example.com#anchor. Stored as https://example.com#anchor.
    • After: Same as before—stored and displayed as https://example.com#anchor.
  • 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 as internal:/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.
  • With Fragment:
    • Before: User types /custom/path#part. Stored as internal:/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.
  • 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 as internal:/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 to entity:node/1. If edited to a non-entity path, it becomes internal:/updated-page.
  • With Fragment:
    • Before: Link stored as internal:/my-page#section. User edits to /updated-page#newsection. Stored as internal:/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 to entity:node/1#newsection. If edited to a non-entity path, it becomes internal:/updated-page#newsection.

External Link:

  • Without Fragment:
    • Before: Link stored as https://example.com. User edits to https://newexample.com. Stored as https://newexample.com.
    • After: Same as before.
  • With Fragment:
    • Before: Link stored as https://example.com#anchor. User edits to https://newexample.com#newanchor. Stored as https://newexample.com#newanchor.
    • After: Same as before. Fragments are preserved.

Relative Link:

  • Without Fragment:
    • Before: Link stored as internal:/custom/path. User edits to /new/path. Stored as internal:/new/path.
    • After: Same. If the new path resolves to an entity, it converts to entity:...; otherwise, stays relative.
  • With Fragment:
    • Before: Link stored as internal:/custom/path#part. User edits to /new/path#newpart. Stored as internal:/new/path#newpart.
    • After: Same. If the new path resolves to an entity, it converts to entity:...#newpart; otherwise, stays relative with the fragment.

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:

🇦🇺Australia realityloop

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 as internal:/my-page. If alias changes to /new-page, link breaks.
    • After: User types /my-page or selects from autocomplete. Stored as entity:node/1 (internal route). Displayed as /my-page (alias). If alias changes, link still works.
  • With Fragment:
    • Before: User types /my-page#section in the link field. Stored as internal:/my-page#section. If alias changes to /new-page, link breaks.
    • After: User types /my-page#section or selects from autocomplete. Stored as entity:node/1#section (internal route). Displayed as /my-page#section (alias with fragment). If alias changes, link still works.
  • 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 as https://example.com. No change in behavior.
    • After: Same as before—stored and displayed as https://example.com. The change doesn't affect external links.
  • With Fragment:
    • Before: User types https://example.com#anchor. Stored as https://example.com#anchor.
    • After: Same as before—stored and displayed as https://example.com#anchor.
  • 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 as internal:/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.
  • With Fragment:
    • Before: User types /custom/path#part. Stored as internal:/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.
  • 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 as internal:/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 to entity:node/1. If edited to a non-entity path, it becomes internal:/updated-page.
  • With Fragment:
    • Before: Link stored as internal:/my-page#section. User edits to /updated-page#newsection. Stored as internal:/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 to entity:node/1#newsection. If edited to a non-entity path, it becomes internal:/updated-page#newsection.

External Link:

  • Without Fragment:
    • Before: Link stored as https://example.com. User edits to https://newexample.com. Stored as https://newexample.com.
    • After: Same as before.
  • With Fragment:
    • Before: Link stored as https://example.com#anchor. User edits to https://newexample.com#newanchor. Stored as https://newexample.com#newanchor.
    • After: Same as before. Fragments are preserved.

Relative Link:

  • Without Fragment:
    • Before: Link stored as internal:/custom/path. User edits to /new/path. Stored as internal:/new/path.
    • After: Same. If the new path resolves to an entity, it converts to entity:...; otherwise, stays relative.
  • With Fragment:
    • Before: Link stored as internal:/custom/path#part. User edits to /new/path#newpart. Stored as internal:/new/path#newpart.
    • After: Same. If the new path resolves to an entity, it converts to entity:...#newpart; otherwise, stays relative with the fragment.

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.
🇦🇺Australia realityloop

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.

🇦🇺Australia realityloop

@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..?

🇦🇺Australia realityloop

I have implemented title display on the initial link popup as per this image in my MR

🇦🇺Australia realityloop

14 days has now passed.

Commenting to confirm my continuing interest to maintain this module as requested above.

🇦🇺Australia realityloop

Current maintainer has not responded.

🇦🇺Australia realityloop

realityloop changed the visibility of the branch 3539681-add-gitlab-ci to hidden.

🇦🇺Australia realityloop

Please re-open if still relevant

🇦🇺Australia realityloop

we shouldn't remove support for earlier versions of Drupal unless there are breaking changes

🇦🇺Australia realityloop

realityloop made their first commit to this issue’s fork.

🇦🇺Australia realityloop

Current maintainer has contact form disabled on their profile

🇦🇺Australia realityloop

realityloop changed the visibility of the branch drupal11 to hidden.

🇦🇺Australia realityloop

realityloop changed the visibility of the branch 2.x to hidden.

🇦🇺Australia realityloop

realityloop made their first commit to this issue’s fork.

🇦🇺Australia realityloop

@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?

🇦🇺Australia realityloop

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
🇦🇺Australia realityloop

@gold That info was there but got removed in this edit  https://www.drupal.org/node/3168194/revisions/view/13931075/13960101

🇦🇺Australia realityloop

realityloop made their first commit to this issue’s fork.

🇦🇺Australia realityloop

Screenshot of settings form after this change, Notification email section is collapsed by default.

🇦🇺Australia realityloop

realityloop changed the visibility of the branch 3514926-aloow-editing-of to hidden.

🇦🇺Australia realityloop

If you have a case insensitive filesystem (for example for macOS) execute the following

🇦🇺Australia realityloop

add detail for adding mr remotes

🇦🇺Australia realityloop

remove x images

🇦🇺Australia realityloop

Add instructions for developing core using DDEV

🇦🇺Australia realityloop

edit for clarity

🇦🇺Australia realityloop

update instructions for adding additional projects on simplytest.me

🇦🇺Australia realityloop

remove empty heading

🇦🇺Australia realityloop

improve clarity of simplytest.me section

🇦🇺Australia realityloop

formatting

🇦🇺Australia realityloop

fix formatting

🇦🇺Australia realityloop

fix formatting

🇦🇺Australia realityloop

not possible to link to in page title ancors, links removed from table

🇦🇺Australia realityloop

add anchor links to sections

Production build 0.71.5 2024