After adding media, return the user to the media listing they started from

Created on 18 February 2019, over 5 years ago
Updated 7 February 2023, almost 2 years ago

Problem/Motivation

When a user is on the media table listing at `admin/content/media-table`, and use the "add media" button, they eventually get returned to the `admin/content/media` grid.

I'd expect to arrive back at the table version, not the grid.

Proposed resolution

Remember which version of the media listing the user invoked "add media" from, and return them to that.

We can use a destination query parameter, with a form alter, and add this with hook_form_alter().

Bonus points: make this work for all variants of the media library listing. Site builders can easily add more display variants to the view, so maybe the form alter could work by view name, instead of the individual view display?

Remaining tasks

  1. Patch.
  2. Tests.
🐛 Bug report
Status

Needs work

Version

10.1

Component
Media 

Last updated about 7 hours ago

Created by

🇬🇧United Kingdom andrewmacpherson

Live updates comments and jobs are added and updated live.
  • Usability

    Makes Drupal easier to use. Preferred over UX, D7UX, etc.

  • Needs framework manager review

    It is used to alert the framework manager core committer(s) that an issue significantly impacts (or has the potential to impact) multiple subsystems or represents a significant change or addition in architecture or public APIs, and their signoff is needed (see the governance policy draft for more information). If an issue significantly impacts only one subsystem, use Needs subsystem maintainer review instead, and make sure the issue component is set to the correct subsystem.

  • Needs change record

    A change record needs to be drafted before an issue is committed. Note: Change records used to be called change notifications.

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.

Production build 0.71.5 2024