This project is not covered by Drupal’s security advisory policy.
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);
Supporting organizations:
Project information
- Created by lawxen on , updated
This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.
Releases
2.0.1
released 26 January 2025
Works with Drupal: ^10
Install:
Development version: 2.0.x-dev updated 26 Jan 2025 at 09:34 UTC
1.0.0-beta8
released 17 January 2024
Works with Drupal: ^10
Install:
Development version: 1.0.x-dev updated 26 Jan 2025 at 09:38 UTC
