Problem/Motivation

I would like to have the option to default the "Create new revision" radio button to on.

Proposed resolution

Provide integration with the diff module.

In its current state, unless we provide a display mode config as part of the module (initially added then reverted), then the diff module might crash without the #3204468: Undefined index: full in Drupal\diff\Plugin\diff\Layout\VisualInlineDiffLayout->build() or #2452523: Offer a revisions tab for all entities patch

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

sassafrass created an issue. See original summary.

malcomio made their first commit to this issue’s fork.

malcomio’s picture

Having looked at the code, this doesn't seem to be configurable - work in progress in https://git.drupalcode.org/project/sitewide_alert/-/merge_requests/75

malcomio’s picture

Status: Active » Needs review

suryabhi made their first commit to this issue’s fork.

suryabhi’s picture

With MR 76 changes User can able to see the revisions of sitewide alert. The one can revert and delete the revision. User can able to compare the revisions.

suryabhi’s picture

malcomio’s picture

Version: 2.2.1 » 3.0.x-dev
Category: Support request » Feature request

smustgrave’s picture

Status: Needs review » Needs work

This appears to have pipeline issues.

codebymikey made their first commit to this issue’s fork.

codebymikey’s picture

Pushed an update addressing the failing CI tests.

There's however a slight incompatibility with the diff module at the moment though where it throws a fatal error on D11 when doing a visual diff because there's no default view mode configured and the diff module code assumes there should be one.

I've added the default view mode configs into the MR (but no post update hook to install them yet as I'm still weighing options).

Ideally, the diff module should try and support entities with no view modes, then the module may be updated to target that version and up.

Current options:
1. Create view modes.
2. Add documentation that those making use of the diff module will need to add a patch so that it supports entities with no view mode.

edit: On further thought, for backwards compatibility purposes, a strict requirement on the diff module should not be required. It should only be used if the diff module is installed.

codebymikey’s picture

Title: Create new revision - Default to on option » Integrate revision diff support and ability to enable revision creation by default
Issue summary: View changes
Issue tags: +Needs tests
StatusFileSize
new43.8 KB

Attached a static patch of the latest MR that works for my use case.

Works well, but I'm sure it probably won't be merged until test cases have been created for it.

If someone else is willing to pick this up, then feel free to.

codebymikey’s picture

Version: 3.0.x-dev » 3.1.x-dev
StatusFileSize
new44.2 KB

Updated the PR to target 3.1.x instead. And attached static patch of the current MR.

codebymikey’s picture

Issue summary: View changes