5 * Provide views data for diff.module.
9 * Implements hook_views_data().
11 function diff_views_data() {
14 /** @var \Drupal\Core\Entity\EntityTypeInterface $entity_type */
15 foreach (\Drupal::entityTypeManager()->getDefinitions() as $entity_type) {
16 // Add the diff_from and diff_to fields to every revisionable entity type.
17 if ($entity_type->isRevisionable()) {
18 $revision_base_table = $entity_type->getRevisionDataTable() ?: $entity_type->getRevisionTable();
20 $data[$revision_base_table]['diff_from'] = [
21 'title' => t('Diff from'),
22 'help' => 'Diff "from" radio button to compare revisions. Also adds the "Compare" button.',
27 $data[$revision_base_table]['diff_to'] = [
28 'title' => t('Diff to'),
29 'help' => 'Diff "to" radio button to compare revisions.',