Add a (temporary) revision UI to media

Created on 27 June 2019, over 5 years ago
Updated 15 November 2023, about 1 year ago

Problem/Motivation

Media entities in core are revisionable, but have no revision UI yet, see ✨ Add Media revision UI Fixed .

Entity API provides the ability to automatically generate a revision UI for arbitrary entities.

Proposed resolution

Let's use the generic UI provided here as long as there is no UI in core.

User interface changes

As soon as both core's Media and this module are installed, Media will have a revisions tab with a Revisions overview.

✨ Feature request
Status

Closed: outdated

Version

1.0

Component

Entity CRUD admin UI

Created by

πŸ‡©πŸ‡ͺGermany tstoeckler Essen, Germany

Live updates comments and jobs are added and updated live.

Missing content requested by

πŸ‡¦πŸ‡ΊAustralia dpi
11 months ago
Sign in to follow issues

Comments & Activities

  • Issue created by @tstoeckler
  • πŸ‡©πŸ‡ͺGermany tstoeckler Essen, Germany

    Here we go. Needed this, so I thought why not put in Entity API directly since all the parts are already there we just need some glue to put them together. I can also put this in a small glue module if people don't think this is a good place.

    Two notes on the patch:

    1. The workaround for #2927077: $entity->toUrl('revision-*') should fill revision parameter on all applicable routes. β†’ is a bit unfortunate, but it's a hard requirement because of the links generated on the revision overview.
    2. I didn't run into any issues with the "hardcoded" local task even if Media module is uninstalled. Theoretically we could also add dynamic deriver to only add the local task if Media module is installed. I wasn't able to use the DefaultEntityLocalTaskProvider because that would mean the "View" and "Edit" local tasks are duplicated.
  • πŸ‡©πŸ‡ͺGermany tstoeckler Essen, Germany

    Just realized we could do the same for custom blocks and taxonomy terms (and menu links?) if we want, but would love some feedback first.

  • πŸ‡©πŸ‡ͺGermany tstoeckler Essen, Germany

    Hmm... further testing shows that we need another workaround. This really did turn a fair bit less elegant than I originally thought, so I truely don't mind if people think this should be a separate module, but still waiting for feedback first.

  • πŸ‡ΊπŸ‡ΈUnited States moshe weitzman Boston, MA

    We need this at mass.gov. I see an alternate approach at https://www.drupal.org/project/media_revisions_ui β†’ . Would be good to decide if this is going in or just close it. Thanks.

  • πŸ‡©πŸ‡ͺGermany tstoeckler Essen, Germany

    Yes, I saw that one as well, a while back. That one doesn't rely on Entity API so does more heavy-lifting on its own, but may be more appealing for site builders that otherwise wouldn't have Entity API installed. I personally still prefer the approach here but as there doesn't seem to be much movement here, I'm fine with closing this.

    Of course someone could also take the patch here and turn that into a separate module, as well, with a dependency on Entity API.

    Also, on a minor note: Now that #2927077: $entity->toUrl('revision-*') should fill revision parameter on all applicable routes. β†’ has landed, the hunks in RevisionOverviewController (and I guess also in RevisionControllerTrait) are no longer necessary, which would get the patch back to a fairly elegant state. This is only true for 9.1.x, though, so it does not apply to people needing this now.

  • πŸ‡¦πŸ‡ΊAustralia realityloop

    Patch updated to apply against 8.x-1.2

  • πŸ‡³πŸ‡±Netherlands Martijn de Wit πŸ‡³πŸ‡± The Netherlands

    ✨ Add Media revision UI Fixed is committed to core 10.2 that will be released end this year

  • Status changed to Closed: outdated about 1 year ago
  • πŸ‡©πŸ‡ͺGermany tstoeckler Essen, Germany

    Ahh good point, yeah I don't think this is needed anymore. The patch is still there if people want to use it for older versions but it probably doesn't make sense to commit anything here, as far as I can tell.

    Thanks for the bump!

Production build 0.71.5 2024