Problem/Motivation

  • When adding/editing a node, you can define a path (alias) for it (e.g., about-us). In D8 HEAD, as in D7, you do this without a leading slash.
  • When adding/editing a Page Display for a View, you can define a path for it (e.g., admin/content/node). In D8 HEAD, as in D7 Views, you do this without a leading slash.
  • In #2418017: Implement autocomplete UI for the link widget, the Link widget UI is changed such that when you then want to link to these paths in the value of a link field, you need to start with a leading slash. This is to disambiguate linking by path from linking by an autocompleted node title (node titles don't usually start with a slash).
  • This might confuse users.

Proposed resolution

Option 1:

This isn't a problem: defining a path is different from linking to it, so no UX problem.

Option 2:

This is a problem, so change the node and View forms to require a leading slash as well.

Option 3:

This is a problem, so change the Link widget to not require a leading slash. Doing so would mean that the autocompletion would keep giving you choices you're not interested in, so we should usability test whether that is a bigger problem.

Remaining tasks

Either share anecdotal opinions or conduct a usability test to determine which option to proceed with.

User interface changes

API changes

Comments

dawehner’s picture

Title: When defining a node's or View's path, the UI does not want a leading slash. When entering that path in a link field, the UI does want a leading slash. Evaluate the UX of that and what to do about it. » Leading slash in link fields and views has different UX

...

xjm’s picture

Priority: Normal » Major

So, in the Views UI, there are theoretically some places where we might some day want a link widget, but others (like defining the path for a page display itself) that can only ever be a path from user input. I.e. it's inventing a new path, not referencing an existing one. This latter case is true of path aliases for nodes as well.

I think option 2 has a few sub-cases:

  • Require a slash in the UI always, and fail validation if it's not provided.
  • Expect a slash, but append it during the submit handler for the plugin (not hither and thither in the codebase) if it's not provided.
  • Denote that the slash will automatically be appended in the UI by displaying a / in front of the actual field, which will also help the user understand what to put in the field, and append the slash during submit handling.
  • Convert to the link widget some day where appropriate (where it's actually links and not defining a new path).

Also, this slash-or-no-slash expectation for the link widget was considered the best solution UX-wise to support an autocompleted link to a thing (the far more usable option) while still allowing the entry of a specific path without the annoyance of the autocomplete getting in the way. (Edit: so IMO option 3 is not a good choice.) However, it already has a UX tradeoff there for being able to toggle between the autocomplete behavior and the other behavior. I think that being inconsistent or inexplicit about that expectation elsewhere in the UI is seriously confusing and WTFy. So based on that I think this is major.

xjm’s picture

xjm’s picture

yoroy’s picture

Issue tags: +UMN 2015

Something to potentially weave into the upcoming usability testing.

Mac_Weber’s picture

Thank you @xjm for pointing the sub-cases for option 2.

Whatever path we choose for fixing this issue should be consistent across the whole system.

This means that in the future other sub-systems or other contrib modules may also have the autocomplete implemented for input of a link OR title, and it makes sense that all these inputs behave in the same way.

The end user does not need to know the difference between defining a path and linking to a path. Then, option 1 is not a good choice.

Maybe this should be more than a patch, but a policy to encourage the use of leading slash and its validation when the input is path definition.

In this case where the input may be either a path definition of a link to a path it should have two validations. The first would check for the leading slash, the other would be responsible for linking to a valid and alre. The presence or not of the leading slash would indicate which validation should be run.

Denote that the slash will automatically be appended in the UI by displaying a / in front of the actual field, which will also help the user understand what to put in the field, and append the slash during submit handling.

I have to assume I was really confused with the leading slash in front of the field. Maybe an input place holder would look better. Actually, I think just a help text with example linking to an existing title and an example defining a internal path would be even better. Do not add the leading slash as a field prefix, because it would be awkward when the user has to input the slash again for a path definition.

In summary:

  • linking to an existing path: autocomplete
  • defining a path: user must input leading slash
  • Do not add / as field prefix - it may be awkward if the user has to input the slash one more time
  • Add help text explaining the autocomplete may link to an existing path, or user must add a leading / to define a new one
  • Be consistent across the system with this behavior
Mac_Weber’s picture

Component: link.module » views.module
Issue tags: +Needs usability review, +Needs subsystem maintainer review, +Needs product manager review

Moving to Views, as we also need to discuss this issue there.

webchick’s picture

I would tend to agree with #6. In the future, we could always add explore other niceties like auto-prepending "/" where it's missing in form submit on those fields where we always expect a path. Also agreed that putting a "/" visibly before the field just introduces inconsistency at a different point.

webchick’s picture

webchick’s picture

Priority: Major » Normal
Issue tags: -UMN 2015

Untagging, and demoting, since this didn't really come up in usability testing. The good news is most people figured out the fact that you could now type a title in the link field. Hooray. So hopefully this inconsistency will bite people less than I initially worried it would.

webchick’s picture

Linking #2474471: Views page displays do not accept an integer as path as an example of a patch that has to do some dumb things to get around this issue.

benjy’s picture

This just caught me out, i've just got used to enter /path everywhere, I feel that views should work the same way.

Bojhan’s picture

Issue tags: -Needs usability review

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

yoroy’s picture

I do stumble on this regularly, consistently.

dawehner’s picture

@yoroy
So you actually vote for using a starting slash in views as well?

yoroy’s picture

Well what I notice is that I always forget to start with a leading slash. So I'd rather not have to think about adding it myself.

Bojhan’s picture

@yoroy yup, me too - thats also how I expect it to work.

dawehner’s picture

As the issue summary says #2418017: Implement autocomplete UI for the link widget introduced this slash behaviour. If we come up with a way to keep the autocompletion sort of working, that would be great.

Wim Leers’s picture

+1 for making the auto-complete forgiving, i.e. by making it auto-complete even without a leading slash. I think this would address the usability concerns.

-1 for making paths without a leading slash valid input. Was discussed at length in #2418017: Implement autocomplete UI for the link widget and elsewhere.


@yoroy and @Bojhan, don't you have this expectation because that's how it worked for the past 10 years? Having a leading slash makes more sense because that's how relative URLs work. That's what relative URLs are. Having a leading slash means this is a valid URL you can copy/paste anywhere in the site — including in your content — and have it work.

yoroy’s picture

I *know* what a relative path is, and still I always make this mistake. Typical example of the difference between how people expect things to work and how it really works under the hood :-)

Wim Leers’s picture

But isn't this (bad) muscle memory from Drupal 7, 6 and before?

Also, this is not "under the hood" IMO. This is literally moving away from a Drupalism.

Also:

+1 for making the auto-complete forgiving, i.e. by making it auto-complete even without a leading slash. I think this would address the usability concerns.

dawehner’s picture

+1 for making the auto-complete forgiving, i.e. by making it auto-complete even without a leading slash. I think this would address the usability concerns.

So you basically argue for the current behaviour in HEAD, right?

@yoroy and @Bojhan, don't you have this expectation because that's how it worked for the past 10 years? Having a leading slash makes more sense because that's how relative URLs work. That's what relative URLs are. Having a leading slash means this is a valid URL you can copy/paste anywhere in the site — including in your content — and have it work.

Yeah I think there is no system out there where you have to start using a slash in menu links.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

pingers’s picture

This is pretty screwed up in the context of customizing an RSS feed.

I'm trying to use the following config for a views feed display.
Format: RSS Feed
Show: Fields

Mapping "Content: Path" field to the link field passes in "/path-to/node". Note the leading slash... which causes RssFields::render() to add second leading slash and thenUrl::fromUserInput() interprets "path-to" as the host name. Not sure how to work around it.

EDIT: Workaround I found was add an ID field, then a custom text field with "node/{{nid}}" in it... then the url gets replaced with the nice path alias. Good enough.

ao2’s picture

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

catch’s picture

Version: 8.6.x-dev » 8.7.x-dev
Category: Task » Bug report
Priority: Normal » Major

Bumping this to major bug and marking #3064119: Symfony\Component\Routing\Exception\MissingMandatoryParametersException: Some mandatory parameters are missing ("taxonomy_term") to generate a URL as duplicate - it's possible to create an unrecoverable view in the UI.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.9 was released on November 6 and is the final full bugfix release for the Drupal 8.7.x series. Drupal 8.7.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.8.0 on December 4, 2019. (Drupal 8.8.0-beta1 is available for testing.)

Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

colan’s picture

Consistency is one thing, but the other problem (at least in Views' Rewrite Results -> Output this field as a custom link) is that the help text doesn't specify whether there should be a slash or not. The form gets submitted in both cases, with no feedback for as to which form is correct. Is one invalid? There's no way to know. Users have to try both ways and see what happens.

If there were at least an example or guidance here, consistency would be secondary. At least folks would know what to enter in each particular field.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

catch’s picture