diff options
Diffstat (limited to 'modules/gallery/helpers/gallery_event.php')
-rw-r--r-- | modules/gallery/helpers/gallery_event.php | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/modules/gallery/helpers/gallery_event.php b/modules/gallery/helpers/gallery_event.php index 679d65c2..1d8e3581 100644 --- a/modules/gallery/helpers/gallery_event.php +++ b/modules/gallery/helpers/gallery_event.php @@ -30,21 +30,23 @@ class gallery_event_Core { static function user_deleted($user) { $admin = identity::admin_user(); - db::build() - ->update("tasks") - ->set("owner_id", $admin->id) - ->where("owner_id", "=", $user->id) - ->execute(); - db::build() - ->update("items") - ->set("owner_id", $admin->id) - ->where("owner_id", "=", $user->id) - ->execute(); - db::build() - ->update("logs") - ->set("user_id", $admin->id) - ->where("user_id", "=", $user->id) - ->execute(); + if (!empty($admin)) { // could be empty if there is not identity provider + db::build() + ->update("tasks") + ->set("owner_id", $admin->id) + ->where("owner_id", "=", $user->id) + ->execute(); + db::build() + ->update("items") + ->set("owner_id", $admin->id) + ->where("owner_id", "=", $user->id) + ->execute(); + db::build() + ->update("logs") + ->set("user_id", $admin->id) + ->where("user_id", "=", $user->id) + ->execute(); + } } static function identity_provider_changed($old_provider, $new_provider) { |