Problem/Motivation

Diff 2.1.0 was just released with entity -agnostic support!

Given the relatively new nature of the generic revisioning UIs in core and how long everyone has been rolling their own for custom entity types, the enabling criteria for full compatibility should be documented for module developers.

Steps to reproduce

Try to use diff with ancient entity types and note that the route subscriber may not apply (and the custom entities may retain the core revisioning UI).

Proposed resolution

Write a documentation page that outlines what custom entity types must implement to be fully compatible with diff.

Remaining tasks

  1. Write the docs.
  2. Apply the docs to a custom entity type that was previously ineligible
  3. Profit.

User interface changes

None

API changes

None

Data model changes

None

Comments

luke.leber created an issue. See original summary.

luke.leber’s picture

Title: Document prerequisites for custom entities to be fully compatible » Document prerequisites for custom entities to be fully compatible with enhancements
m.stenta’s picture

Maybe this will help someone else... I ran into an issue while converting our custom entity types from the Entity API's RevisionRouteProvider to Drupal core's new RevisionHtmlRouteProvider: #3596981: Uncaught PHP Exception: revision_translation_affected not found

Our custom entity types did not have revision_data_table defined in their entity definitions. Drupal's documentation doesn't specify it, so there may be many others who experience the same issue.

In the end, we had to add revision_data_table to the entity definitions, and also add an update hook to update them.

For an example, see: #3600574: Use Drupal core RevisionHtmlRouteProvider

m.stenta’s picture

Another thing we had to do was provide permissions for viewing/reverting revisions, and implement hook_entity_access() to check for them. See: #3601012: Fix access to log entity revisions

Entity API handled this for us previously.