- Issue created by @kopeboy
- 🇮🇹Italy kopeboy Milan
Even if you don't want to use Views for the selection method, I don't see revisions appear with the default autocomplete either!
- 🇮🇹Italy kopeboy Milan
I couldn't make a Views of revisions work as a reference method (it seems we need to change core?), so I made this field widget as a temporary workaround that provides an options select list of revisions.
It filters for the allowed bundle from the entity_reference_revisions field's settings, revision author (uid) = current user, it removes current revisions, and displays max 10 results, sorted descending by creation timestamp. It even allows customizing the option text in the widget settings with @title, @date, @log substitutions (html tags will be stripped from the revision log message if present).
Put it in your custom module or directly in entity_reference_revisions (fix the namespace at the top of the file accordingly), at
/src/Plugin/Field/FieldWidget/CurrentUserRevisionSelectWidget.php
and flush caches.I hope it helps and can even be included as a sub module.
- 🇮🇹Italy kopeboy Milan
Here a more robust alternative, that includes both a field widget "Select list of alternative revisions" (that no longer filters for the current user as author by default, but allows that as the widget configuration), and a field formatter "Configurable label + diff link", that allows configuring a label with substitutions, provides a button link to view the revision and, if diff module is enabled, another button to compare the selected revision with the current (default) revision.