Problem/Motivation

When an alias is created or updated the status message reads "Created new alias /new-path-alias for /node/[nid]". Consider improving the language to make it more friendly for content editors.

Steps to reproduce

Edit a content node and update the url alias.

Proposed resolution

Change the word “alias” inside the help text that appears, to be “path” and make the new alias a clickable link.

Issue fork pathauto-3419907

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

minirobot created an issue. See original summary.

minirobot’s picture

Adding a patch.

minirobot’s picture

Updated the patch to add the "path" text change.

penyaskito’s picture

Status: Active » Needs review

Let's see if tests pass or anything needs to be amended there.

Status: Needs review » Needs work

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

ressa’s picture

Please note that DrupalCI and all patch testing will be turned off on July 1, 2024, so generally speaking, it's probably better to create a patch and Merge Request with the Gitlab integration, to be better prepared in advance of the eventual phase out.

juandels3’s picture

Issue summary: View changes
StatusFileSize
new9.02 KB

Where can the message shown in the issue be reproduced? Is it related to the Pathauto module or Path? I only see this status message when I create or modify a URL Alias.
Status message Alias url

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

mably’s picture

Status: Needs work » Needs review
mably’s picture

Status: Needs review » Needs work

Tests are failing.

mably’s picture

Status: Needs work » Needs review

Tests are passing again.

mably’s picture

Code review of MR #123

The two commits improve the status message displayed when pathauto creates or updates a URL alias, making it more user-friendly for content editors.

Changes

AliasStorageHelper — Two improvements to the status messages:

  • The word "alias" is replaced with "path", which is more accessible to non-technical users.
  • The alias is now rendered as a clickable link using Link::fromTextAndUrl(), allowing editors to quickly navigate to the new path. The placeholder changes from %alias (escaped text) to @alias (raw markup) so the link HTML is rendered correctly.

PathautoSettingsFormWebTest — The two pageTextContains assertions are updated from "Created new alias" to "Created new path" to match the new wording.

The fix is correct and straightforward.

mably’s picture

Assigned: Unassigned » berdir
anybody’s picture

Assigned: berdir » Unassigned
Status: Needs review » Needs work

@minirobot

The alias is now rendered as a clickable link using Link::fromTextAndUrl(), allowing editors to quickly navigate to the new path. The placeholder changes from %alias (escaped text) to @alias (raw markup) so the link HTML is rendered correctly.

isn't that incorrect?
@ and % are both sanitzied, but % highlights the string in <em> which makes sense here.

See https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Component%21Rend...

mably’s picture

Status: Needs work » Needs review

Fixed that small hallucination 😉

berdir’s picture

The field in the UI is called "URL alias", I think if anything we should use the same, not path.

admin/config/search/path/add also uses URL Alias and System path, using path here is in the middle of these two terms and makes it worse, not better.

These messages are I think also off by default and few editors will see them in practice.

anybody’s picture

Did you test that it works with the link like this? I guess it will still be escaped? (Just looking at the code). Maybe better split the text and the link in the message?

And maybe the text should better be:

Created new path alias %alias ...

?
Maybe you could post a screenshot from the result?

mably’s picture

Are you ok with "path alias" @berdir or should we close it as "Won't fix"?

berdir’s picture

I guess #19 was a crosspost, just one minute after me. IMHO it's either "URL Alias" or won't fix, don't care too much which it is, it's hidden in a verbose logging setting, I don't know how many have this one but I guess not many, I think most editors/sites don't need this information at all.

mably’s picture

@anybody, what do you prefer? "Created new URL alias %alias..." or "Won't fix"?

You choose 😉

anybody’s picture

@mably I agree with berdir, but I like

Created new URL alias %alias

and it will make things better, so let's do it.

  • mably committed 15f216d3 on 8.x-1.x
    task: #3419907 Improve status message on alias create/update
    
    By:...
mably’s picture

Status: Needs review » Fixed

It's done.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

mably’s picture

Category: Feature request » Task

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.