Drupal is a registered trademark of Dries Buytaert
cms 2.1.3 Update released for Drupal core (2.1.3)! drupal 10.5.11 Update released for Drupal core (10.5.11)! drupal 11.3.11 Update released for Drupal core (11.3.11)! drupal 11.2.13 Update released for Drupal core (11.2.13)! drupal 10.6.10 Update released for Drupal core (10.6.10)! cms 2.1.2 Update released for Drupal core (2.1.2)! drupal 11.1.10 Update released for Drupal core (11.1.10)! drupal 10.5.10 Update released for Drupal core (10.5.10)! drupal 10.4.10 Update released for Drupal core (10.4.10)! drupal 11.2.12 Update released for Drupal core (11.2.12)! drupal 11.3.10 Update released for Drupal core (11.3.10)! drupal 10.6.9 Update released for Drupal core (10.6.9)! drupal 10.6.8 Update released for Drupal core (10.6.8)! drupal 11.3.9 Update released for Drupal core (11.3.9)! drupal 11.3.8 Update released for Drupal core (11.3.8)! drupal 11.3.7 Update released for Drupal core (11.3.7)! drupal 11.2.11 Update released for Drupal core (11.2.11)! drupal 10.6.7 Update released for Drupal core (10.6.7)! drupal 10.5.9 Update released for Drupal core (10.5.9)! cms 2.1.1 Update released for Drupal core (2.1.1)!

views_cleanup

No security coverage
View on drupal.org

This module is initally created for helping uninstall module: multiversion

Add some services to cleanup views easily

Services:

  • views_cleanup.filter_cleanup
  • views_cleanup.filter_replacement
  • views_cleanup.filter_add
  • views_cleanup.aggregate_views_filter_option
  • views_cleanup.denpendencies
  • views_cleanup.fields_cleanup

Examples

\Drupal::service('views_cleanup.filter_cleanup')
->cleanupViewsFiltersByFilterCheckOptions(['entity_field' => '_deleted']);
\Drupal::service('views_cleanup.denpendencies')
->cleanupViewsDependencyModules(['multiversion']);
  $new_filter_config = [
    'id' => 'deleted',
    'table' => 'node_field_data',
    'field' => 'deleted',
    'relationship' => 'none',
    'group_type' => 'group',
    'admin_label' => '',
    'entity_type' => 'node',
    'entity_field' => 'deleted',
    'plugin_id' => 'date',
    'operator' => 'not empty',
    'value' => ['min' => '', 'max' => '', 'value' => '', 'type' => 'date',],
    'group' => 1,
    'exposed' => FALSE,
    'expose' => [
      'operator_id' => '',
      'label' => '',
      'description' => '',
      'use_operator' => FALSE,
      'operator' => '',
      'operator_limit_selection' => FALSE,
      'operator_list' => [],
      'identifier' => '',
      'required' => FALSE,
      'remember' => FALSE,
      'multiple' => FALSE,
      'remember_roles' => ['authenticated' => 'authenticated',],
      'min_placeholder' => '',
      'max_placeholder' => '',
      'placeholder' => '',
    ],
    'is_grouped' => FALSE,
    'group_info' => [
      'label' => '',
      'description' => '',
      'identifier' => '',
      'optional' => TRUE,
      'widget' => 'select',
      'multiple' => FALSE,
      'remember' => FALSE,
      'default_group' => 'All',
      'default_group_multiple' => [],
      'group_items' => [],
    ],
  ];
\Drupal::service('views_cleanup.filter_replacement')
  ->replaceViewsFilterByFilterCheckOptions([
    'entity_type' => 'node',
    'entity_field' => '_deleted',
    'operator' => '=',
    'value' => '1',
  ], 'deleted', $new_filter_config);

Activity

Total releases
2
First release
Jan 2025
Latest release
1 year ago
Release cadence
0 days
Stability
50% stable

Releases

Version Type Release date
2.0.1 Stable Jan 26, 2025
2.0.x-dev Dev Jan 26, 2025