I need to stop a node from being deleted whereas a delete operation is carried out on it. For instance in administration panel if consumer clicks "Delete" on Drupal Developer node, Drupal Developer node should not be deleted if he isn’t an administrator. Permissions and consumer roles are usually not an issue for me, Drupal Developer drawback is "stopping" delete operation.
I discovered hook_entity_predelete()
, which is ideal, it runs precisely simply earlier than deleting Drupal Developer node, however I do not know learn how to cease delete operation. I need to do some issues inside that hook and forestall deleting Drupal Developer node.
I noticed additionally this problem: How do I stop a Node from being deleted? with hook_node_access()
, but it surely just isn’t working as I want.
hook_entity_delete()
can be not okay, as a result of This hook runs as soon as Drupal Developer entity has been deleted from Drupal Developer storage
. I want to forestall it.
Thanks in your assist.