From b7b04a61d682746afd2b1914c30b8a3274cfa152 Mon Sep 17 00:00:00 2001 From: Arno Kaimbacher Date: Tue, 19 Feb 2019 18:52:52 +0100 Subject: [PATCH] error fix in the publication process --- .../Controllers/Frontend/SearchController.php | 21 +++++++++---------- .../Controllers/Publish/IndexController.php | 4 ++-- app/Models/Dataset.php | 20 +++++++++--------- composer.lock | 20 +++++++++--------- .../partials/simpleSearchForm.blade.php | 2 +- .../views/publish/create-step1.blade.php | 4 ++-- 6 files changed, 35 insertions(+), 36 deletions(-) diff --git a/app/Http/Controllers/Frontend/SearchController.php b/app/Http/Controllers/Frontend/SearchController.php index e6d5c0b..58655a9 100644 --- a/app/Http/Controllers/Frontend/SearchController.php +++ b/app/Http/Controllers/Frontend/SearchController.php @@ -54,21 +54,20 @@ class SearchController extends Controller } } - public function search1(Request $request): View - { - $this->_request = $request; - $data = $request->all(); - //$this->searchtype = $request->input('searchtype'); - $this->searchtype = $request->input('searchtype'); - return view('frontend.solrsearch.index'); - } + // public function search1(Request $request): View + // { + // $this->_request = $request; + // $data = $request->all(); + // $this->searchtype = $request->input('searchtype'); + // return view('frontend.solrsearch.index'); + // } public function search(Request $request): View { Log::info('Received new search request. Redirecting to search action of IndexController.'); $this->_request = $request; - //$filter =$request->input('query'); + $filter =$request->input('query'); // $query = $this->client->createSelect(); // $query->setQuery('%P1%', array($filter)); // // $query->setQuery('*:*'); @@ -91,9 +90,9 @@ class SearchController extends Controller $results = $this->resultList->getResults(); $numOfHits = $this->numOfHits; - return view('frontend.solrsearch.index', compact('results', 'numOfHits')); + return view('frontend.solrsearch.index', compact('results', 'numOfHits', 'filter')); } - return view('frontend.solrsearch.index'); + return view('frontend.solrsearch.index', compact('filter')); } /** diff --git a/app/Http/Controllers/Publish/IndexController.php b/app/Http/Controllers/Publish/IndexController.php index ef88705..f30c123 100644 --- a/app/Http/Controllers/Publish/IndexController.php +++ b/app/Http/Controllers/Publish/IndexController.php @@ -391,8 +391,8 @@ class IndexController extends Controller if (isset($data['geolocation'])) { $formGeolocation = $request->input('geolocation'); - if ($formGeolocation['xmin'] !== '' && $formGeolocation['ymin'] !== '' && - $formGeolocation['xmax'] !== '' && $formGeolocation['ymax'] !== '') { + if ($formGeolocation['xmin'] !== null && $formGeolocation['ymin'] !== null && + $formGeolocation['xmax'] !== null && $formGeolocation['ymax'] !== null) { $geolocation = new GeolocationBox($formGeolocation); $dataset->geolocation()->save($geolocation); } diff --git a/app/Models/Dataset.php b/app/Models/Dataset.php index 67e0128..79e4ea4 100644 --- a/app/Models/Dataset.php +++ b/app/Models/Dataset.php @@ -26,16 +26,16 @@ class Dataset extends Model const UPDATED_AT = 'server_date_modified'; const PUBLISHED_AT = 'server_date_published'; - // protected $fillable = [ - // 'type', - // 'language', - // 'server_state', - // 'creating_corporation', - // 'project_id', - // 'embargo_date', - // 'belongs_to_bibliography', - // ]; - protected $guarded = []; + protected $fillable = [ + 'type', + 'language', + 'server_state', + 'creating_corporation', + 'project_id', + 'embargo_date', + 'belongs_to_bibliography', + ]; + //protected $guarded = []; /** * The attributes that should be mutated to dates. * diff --git a/composer.lock b/composer.lock index 6948635..0212e94 100755 --- a/composer.lock +++ b/composer.lock @@ -1232,16 +1232,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.2.0", + "version": "v4.2.1", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "594bcae1fc0bccd3993d2f0d61a018e26ac2865a" + "reference": "5221f49a608808c1e4d436df32884cbc1b821ac0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/594bcae1fc0bccd3993d2f0d61a018e26ac2865a", - "reference": "594bcae1fc0bccd3993d2f0d61a018e26ac2865a", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/5221f49a608808c1e4d436df32884cbc1b821ac0", + "reference": "5221f49a608808c1e4d436df32884cbc1b821ac0", "shasum": "" }, "require": { @@ -1279,7 +1279,7 @@ "parser", "php" ], - "time": "2019-01-12T16:31:37+00:00" + "time": "2019-02-16T20:54:15+00:00" }, { "name": "paragonie/random_compat", @@ -3664,16 +3664,16 @@ }, { "name": "phpunit/phpunit", - "version": "7.5.4", + "version": "7.5.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "2896657da5fb237bc316bdfc18c2650efeee0dc0" + "reference": "09c85e14994df92e5ff1f5ec0b481bdb7d3d3df9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/2896657da5fb237bc316bdfc18c2650efeee0dc0", - "reference": "2896657da5fb237bc316bdfc18c2650efeee0dc0", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/09c85e14994df92e5ff1f5ec0b481bdb7d3d3df9", + "reference": "09c85e14994df92e5ff1f5ec0b481bdb7d3d3df9", "shasum": "" }, "require": { @@ -3744,7 +3744,7 @@ "testing", "xunit" ], - "time": "2019-02-07T14:15:04+00:00" + "time": "2019-02-18T09:24:50+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", diff --git a/resources/views/frontend/partials/simpleSearchForm.blade.php b/resources/views/frontend/partials/simpleSearchForm.blade.php index a6f70da..159cd9f 100644 --- a/resources/views/frontend/partials/simpleSearchForm.blade.php +++ b/resources/views/frontend/partials/simpleSearchForm.blade.php @@ -3,7 +3,7 @@ - {!! Form::text('query', null, array('class'=>'pure-input-1', 'placeholder'=>'Search for a dataset...')) !!} + {!! Form::text('query', isset($filter) ? $filter : '', array('class'=>'pure-input-1', 'placeholder'=>'Search for a dataset...')) !!}