wieni/wmprotected_vocabulary

Adds the possibility to protect taxonomy terms from being deleted when they are being referenced in certain fields.

Installs: 3 902

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 7

Forks: 1

Open Issues: 1

Type:drupal-module

1.2.0 2023-09-12 12:56 UTC

This package is auto-updated.

Last update: 2024-11-12 15:21:50 UTC


README

Latest Stable Version Total Downloads License

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:

 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 file.

Security

If you discover any security-related issues, please email security@wieni.be instead of using the issue tracker.

License

Distributed under the MIT License. See the LICENSE file for more information.