Fix idempotency issue with deletion

https://github.com/farmOS/farmOS/issues/232
This commit is contained in:
Symbioquine 2020-01-19 11:08:55 -08:00 committed by Michael Stenta
parent 36d2ff9ff3
commit 55a1e390a4
1 changed files with 5 additions and 0 deletions

View File

@ -352,6 +352,11 @@ function farm_constraint_restws_request_alter(array &$request) {
// Get the entity.
$entity = $request['resource']->read($id);
// If the entity doesn't exist it cannot have constraints.
if (empty($entity)) {
return;
}
// Get the entity bundle.
list($entity_id, $revision_id, $bundle) = entity_extract_ids($type, $entity);