diff --git a/app/controllers/admin/UsersController.php b/app/controllers/admin/UsersController.php index a109f8b6a007..b56a61d7a8b7 100755 --- a/app/controllers/admin/UsersController.php +++ b/app/controllers/admin/UsersController.php @@ -267,6 +267,7 @@ public function postEdit($id = null) // Create a new validator instance from our validation rules $validator = Validator::make(Input::all(), $this->validationRules); + // If validation fails, we'll exit the operation now. if ($validator->fails()) { @@ -287,6 +288,14 @@ public function postEdit($id = null) $user->location_id = Input::get('location_id'); $user->manager_id = Input::get('manager_id'); + if ($user->manager_id == "") { + $user->manager_id = NULL; + } + + if ($user->location_id == "") { + $user->location_id = NULL; + } + // Do we want to update the user password? if ($password)