Unable to create page with "/media-library/some-path" path alias

Created on 21 May 2019, over 5 years ago
Updated 25 February 2023, almost 2 years ago

Problem/Motivation

  1. Enable Media-library experimental module
  2. Create node type Page with path alias "/media-library/some-path"
  3. PHP Error appear

Proposed resolution

Seems when you have a path with many parts the Breadcrumb builder trying to check access for each part, but fails 'cause /media-library route requires additional query params on it. Right now route "media_library.ui" can't be used without query params, but instead of denying access on checking access by breadcrumb builder it throws an exception.

Remaining tasks

Check for query params before creating instance of \Drupal\media_library\MediaLibraryState in \Drupal\media_library\MediaLibraryState::fromRequest method. So probably we need to add exception to fromRequest() method

User interface changes

No interface changes.

API changes

Add an InvalidArgumentsException to \Drupal\media_library\MediaLibraryState::fromRequest()

πŸ› Bug report
Status

Closed: cannot reproduce

Version

10.1 ✨

Component
MediaΒ  β†’

Last updated 1 day ago

Created by

πŸ‡ΊπŸ‡¦Ukraine zviryatko

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡³πŸ‡ΏNew Zealand quietone

    I tested this on Drupal 10.1.x, standard install. I used the steps given in the issue summary. I tested as both an admin user and as a content editor. In both cases adding a url alias /media-library/some-path when creating a page did not cause an error. I also tried /media/some-path and that worked as well.

    @zviryatko, is there a step missing?

    Therefore, closing as cannot reproduce. If you are experiencing this problem on a supported version of Drupal reopen the issue, by setting the status to 'Active', and provide complete steps to reproduce the issue β†’ (starting from "Install Drupal core").

    Thanks!

Production build 0.71.5 2024