https://github.com/wieni/wmprotected_vocabulary
Adds the possibility to protect taxonomy terms from being deleted when they are being referenced in certain fields.
https://github.com/wieni/wmprotected_vocabulary
drupal-8 drupal-module drupal8-module
Last synced: 3 months ago
JSON representation
Adds the possibility to protect taxonomy terms from being deleted when they are being referenced in certain fields.
- Host: GitHub
- URL: https://github.com/wieni/wmprotected_vocabulary
- Owner: wieni
- License: mit
- Created: 2019-01-10T08:31:09.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2023-09-12T12:57:06.000Z (over 1 year ago)
- Last Synced: 2025-01-27T20:11:33.145Z (4 months ago)
- Topics: drupal-8, drupal-module, drupal8-module
- Language: PHP
- Homepage:
- Size: 20.5 KB
- Stars: 0
- Watchers: 8
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
wmprotected_vocabulary
======================[](https://packagist.org/packages/wieni/wmprotected_vocabulary)
[](https://packagist.org/packages/wieni/wmprotected_vocabulary)
[](https://packagist.org/packages/wieni/wmprotected_vocabulary)> Adds the possibility to protect taxonomy terms from being deleted when they are being referenced in certain fields.
## Why?
- Deleting a taxonomy term when it is still being referenced on another
entity can do a lot of damage if the underlying code doesn't handle
this situation.
- This could be fixed by doing null checks in your code, but sometimes
it makes more sense to just prevent the user from deleting those
terms.## Installation
This package requires PHP 7.1 and Drupal 8 or higher. It can be
installed using Composer:```bash
composer require wieni/wmprotected_vocabulary
```## How does it work?
When trying to delete a protected taxonomy term with references, a
message is shown and the confirmation button will be disabled.### Configuration
The functionality can be enabled on a per-vocabulary level by checking
the _Protect_ checkbox on the vocabulary edit page. The _Protect fields_
option can be used to configure which fields should be used when
counting the references of a taxonomy term.## Changelog
All notable changes to this project will be documented in the
[CHANGELOG](CHANGELOG.md) file.## Security
If you discover any security-related issues, please email
[[email protected]](mailto:[email protected]) instead of using the issue
tracker.## License
Distributed under the MIT License. See the [LICENSE](LICENSE.md) file
for more information.