Problem/Motivation

Need to delete 30 million flags using "Remove Flaggings" in the Module Uninstall page. The delete is very slow and frequent out of memory errors are displayed.

Steps to reproduce

Create a large number of flags. Use "Remove Flaggings" in the Module Uninstall page to remove the flags

Proposed resolution

Each flag entity delete calls hook flag\_entity\_predelete and then it finds the related flag entity in the storage and deletes it. This step is unnecessary when a flagging entity is deleted. Add a condition to check before proceeding the find the related entities.

Remaining tasks

NIL

User interface changes

NIL

API changes

NIL

Data model changes

NIL