diff --git a/app/lang/en/admin/locations/message.php b/app/lang/en/admin/locations/message.php index 982d2b3603..3ba1eed3b6 100755 --- a/app/lang/en/admin/locations/message.php +++ b/app/lang/en/admin/locations/message.php @@ -5,7 +5,7 @@ return array( 'does_not_exist' => 'Location does not exist.', 'assoc_users' => 'This location is currently associated with at least one user and cannot be deleted. Please update your users to no longer reference this location and try again. ', 'assoc_assets' => 'This location is currently associated with at least one asset and cannot be deleted. Please update your assets to no longer reference this location and try again. ', - 'assoc_child_loc' => 'This location is currently the parent of at least one asset and cannot be deleted. Please update your locations to no longer reference this location and try again. ', + 'assoc_child_loc' => 'This location is currently the parent of at least one child location and cannot be deleted. Please update your locations to no longer reference this location and try again. ', 'create' => array( diff --git a/app/models/Location.php b/app/models/Location.php index 5f6fd95b38..8a83eaa809 100755 --- a/app/models/Location.php +++ b/app/models/Location.php @@ -33,7 +33,7 @@ class Location extends Elegant } public function childLocations() { - return $this->hasMany('Location','id')->where('parent_id','=',$this->id); + return $this->hasMany('Location','parent_id'); } public static function getLocationHierarchy($locations, $parent_id = null) {