Fix for strict mode with location parent
This commit is contained in:
@@ -22,3 +22,4 @@ public/uploads/logo.gif
|
||||
public/uploads/logo.png
|
||||
.siteflow
|
||||
public/assets/.siteflow
|
||||
.settings/settings.json
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
return array (
|
||||
'app_version' => 'v1.2.7-8',
|
||||
'hash_version' => 'v1.2.7-8-g0d23332',
|
||||
'app_version' => 'v1.2.7-9',
|
||||
'hash_version' => 'v1.2.7-9-g68d8b10',
|
||||
);
|
||||
@@ -38,7 +38,7 @@ class LocationsController extends AdminController
|
||||
public function getCreate()
|
||||
{
|
||||
// Show the page
|
||||
$location_options = array('' => '') + Location::lists('name', 'id');
|
||||
$location_options = array('' => 'Top Level') + Location::lists('name', 'id');
|
||||
return View::make('backend/locations/edit')->with('location_options',$location_options)->with('location',new Location);
|
||||
}
|
||||
|
||||
@@ -62,7 +62,11 @@ class LocationsController extends AdminController
|
||||
|
||||
// Save the location data
|
||||
$location->name = e(Input::get('name'));
|
||||
$location->parent_id = e(Input::get('parent_id'));
|
||||
if (Input::get('parent_id')=='') {
|
||||
$location->parent_id = null;
|
||||
} else {
|
||||
$location->parent_id = e(Input::get('parent_id',''));
|
||||
}
|
||||
$location->address = e(Input::get('address'));
|
||||
$location->address2 = e(Input::get('address2'));
|
||||
$location->city = e(Input::get('city'));
|
||||
@@ -105,7 +109,7 @@ class LocationsController extends AdminController
|
||||
// Show the page
|
||||
//$location_options = array('' => 'Top Level') + Location::lists('name', 'id');
|
||||
|
||||
$location_options = array('' => '') + DB::table('locations')->where('id', '!=', $locationId)->lists('name', 'id');
|
||||
$location_options = array('' => 'Top Level') + DB::table('locations')->where('id', '!=', $locationId)->lists('name', 'id');
|
||||
return View::make('backend/locations/edit', compact('location'))->with('location_options',$location_options);
|
||||
}
|
||||
|
||||
@@ -137,7 +141,12 @@ class LocationsController extends AdminController
|
||||
|
||||
// Update the location data
|
||||
$location->name = e(Input::get('name'));
|
||||
$location->parent_id = e(Input::get('parent_id'));
|
||||
if (Input::get('parent_id')=='') {
|
||||
$location->parent_id = null;
|
||||
} else {
|
||||
$location->parent_id = e(Input::get('parent_id',''));
|
||||
}
|
||||
|
||||
$location->address = e(Input::get('address'));
|
||||
$location->address2 = e(Input::get('address2'));
|
||||
$location->city = e(Input::get('city'));
|
||||
|
||||
Reference in New Issue
Block a user