Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spike: Investigate Revisioning of Taxonomy Terms #4532

Open
bryanpizzillo opened this issue Jan 2, 2025 · 0 comments
Open

Spike: Investigate Revisioning of Taxonomy Terms #4532

bryanpizzillo opened this issue Jan 2, 2025 · 0 comments
Labels
spike Spike Story/Investigation

Comments

@bryanpizzillo
Copy link
Member

bryanpizzillo commented Jan 2, 2025

Estimate # point

With Drupal 10.3, Taxonomy Terms can now be revisioned. Given the complexities in some of our vocabularies (mainly cgov_site_section, but some of the blog filtering could be affected) we have disabled the revisions tab and the ability to create new revisions. A review of the databases confirms that we do not have any additional revisions for any current taxonomy terms.

This ticket is to investigate what it would take to enable revisions. Revisions allow taxonomy managers to revert changes and supply reasons for the changes.

The code added to cgov_core.module during the upgrade:

/**
 * Implements hook_menu_local_tasks_alter.
 *
 * D10.3 Added revisions for taxonomy terms, but considering how
 * specialized some of our vocabularies are, we need more
 * testing before we support revisions and reverting.
 */
function cgov_core_menu_local_tasks_alter(array &$data, $route_name, RefinableCacheableDependencyInterface &$cacheability) {
  // This hides the revisions tab.
  if ($route_name === 'entity.taxonomy_term.edit_form') {
    if (isset($data['tabs'][0]['entity.version_history:taxonomy_term.version_history'])) {
      unset($data['tabs'][0]['entity.version_history:taxonomy_term.version_history']);
    }
  }
}

/**
 * Implements hook_form_BASE_FORM_ID_alter().
 *
 * D10.3 Added revisions for taxonomy terms, but considering how
 * specialized some of our vocabularies are, we need more
 * testing before we support revisions and reverting.
 */
function cgov_core_form_taxonomy_term_form_alter(&$form, FormStateInterface $form_state, $form_id) {
  // This hides the whole Revision Information vertical tab with the revision
  // checkbox and comments.
  $form['revision_information']['#access'] = FALSE;
}
@bryanpizzillo bryanpizzillo added the spike Spike Story/Investigation label Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
spike Spike Story/Investigation
Projects
None yet
Development

No branches or pull requests

1 participant