diff options
Diffstat (limited to 'engine/lib/objects.php')
-rw-r--r-- | engine/lib/objects.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/engine/lib/objects.php b/engine/lib/objects.php index 8d78bddd8..e44a005ff 100644 --- a/engine/lib/objects.php +++ b/engine/lib/objects.php @@ -225,8 +225,14 @@ // Insert it
$result = insert_data("INSERT into {$CONFIG->dbprefix}objects_entity (guid, title, description) values ($guid, '$title','$description')");
- if ($result!==false)
- return true;
+ if ($result!==false) {
+ $entity = get_entity($guid);
+ if (trigger_event('create',$entity->type,$entity)) {
+ return true;
+ } else {
+ delete_entity($guid);
+ }
+ }
}
return false;
|