Clarify that some words are reserved and cannot be used as Views path

Created on 12 August 2025, 3 days ago

Problem/Motivation

When creating a View page, you may want to use a path such as /libraries. But certain paths are reserved and cannot be used as path in a view, such as "libraries" and "profiles", because these are folders in the root of Drupal's web directory.

Steps to reproduce

  1. Create a Views Page with path /libraries
  2. Visit the page and get the error message "Forbidden - You don't have permission to access this resource."

Proposed resolution

Add a message in the Views Path field description to indicate that folders in the web root such as "core", "libraries", "modules", "profiles", "sites", "themes" exist, so they are reserved words, and cannot be used.

Remaining tasks

Patch
Test
Review
Commit

User interface changes

API changes

None.

Data model changes

None.

πŸ“Œ Task
Status

Active

Version

11.0 πŸ”₯

Component

views.module

Created by

πŸ‡©πŸ‡°Denmark ressa Copenhagen

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @ressa
  • πŸ‡©πŸ‡°Denmark ressa Copenhagen
  • Merge request !12974Add info about reserved paths β†’ (Open) created by ressa
  • πŸ‡©πŸ‡°Denmark ressa Copenhagen
  • Pipeline finished with Success
    3 days ago
    Total: 2038s
    #571325
  • πŸ‡©πŸ‡°Denmark ressa Copenhagen
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Think this can actually be classified as a bug and may need some validation + test coverage. Since it results in a error message.

  • πŸ‡©πŸ‡°Denmark ressa Copenhagen

    Thanks for fast feedback, it's really great that issues can maintain their momentum. I have changed the category to bug, and added some more tasks.

    Thinking more about this, wouldn't it be great, if Drupal listed reserved paths somewhere, perhaps on the Status page? I have added a proposal in the Issue Summary, what do you think?

  • πŸ‡©πŸ‡°Denmark ressa Copenhagen
  • First commit to issue fork.
  • πŸ‡¬πŸ‡§United Kingdom oily Greater London

    I have added test coverage. Leaving the test coverage loose (assertNotContains(200)) as I do not think the validation is in place yet. Once it is, might be best to tighten the test to test for the validation string?

  • Pipeline finished with Failed
    1 day ago
    Total: 267s
    #573250
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Not sure that’s the test coverage we would need. The validation should be that these reserved words can’t be saved. So that’s what the tests should check I would assume.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    @ressa to answer your question not sure status report page would be needed to get the visibility it needs. But definitely should be documented somewhere, maybe the help topic?

  • Pipeline finished with Failed
    1 day ago
    Total: 916s
    #573261
  • Pipeline finished with Canceled
    1 day ago
    Total: 129s
    #573278
  • Pipeline finished with Failed
    1 day ago
    Total: 198s
    #573279
  • Pipeline finished with Failed
    1 day ago
    Total: 166s
    #573291
  • Pipeline finished with Failed
    about 24 hours ago
    Total: 604s
    #573298
  • πŸ‡¬πŸ‡§United Kingdom oily Greater London

    Re: #11 I have added a @todo. To complete the todo may require the validation to be in place to test on the exact validation error text.

  • πŸ‡©πŸ‡°Denmark ressa Copenhagen

    Thanks @oily for adding test coverage, it's a big help.

    @smustgrave: Using the Help page is a great idea, and I have added it in the Issue Summary as well as MR, and demoted the Status page suggestion. We could expand it, and link to it from the Views path field description text? Or maybe it's fine as it is ...

  • Pipeline finished with Failed
    about 4 hours ago
    Total: 382s
    #573798
  • πŸ‡©πŸ‡°Denmark ressa Copenhagen

    Remove Views Help page text from Issue Summary, since it is in the MR.

  • πŸ‡¬πŸ‡§United Kingdom oily Greater London

    I have been searching through the views module to work out where to put the validation for the views page display form. I think it would be in DisplayPluginBase.php perhaps before line 2533. That is where the 'more link' path? is validated. So could add validation for the page display path above or below it? The more link validation seems to have useful error code can be utilised.

Production build 0.71.5 2024