- Bug: data serialisaion on laravel 7.x (Coverage.php)

- solr path without solr string
- composer updates
This commit is contained in:
Arno Kaimbacher 2021-05-27 11:28:57 +02:00
parent b335bd7e9c
commit 9601389d83
4 changed files with 20 additions and 10 deletions

View File

@ -3,6 +3,7 @@ namespace App\Models;
use App\Models\Dataset;
use Illuminate\Database\Eloquent\Model;
use DateTimeInterface;
class Coverage extends Model
{
@ -47,6 +48,16 @@ class Coverage extends Model
{
$this->attributes['time_max'] = empty($date) ? null : \Illuminate\Support\Carbon::createFromFormat('Y-m-d H:i:s', $date);
}
/**
* Prepare a date for array / JSON serialization.
*
* @param \DateTimeInterface $date
* @return string
*/
protected function serializeDate(DateTimeInterface $date)
{
return $date->format('Y-m-d H:i:s');
}
/**
* relationship to dataset

View File

@ -6,6 +6,7 @@ namespace App\Observers;
use App\Models\Dataset;
use Illuminate\Support\Facades\Log;
use App\Library\Search\SolariumAdapter;
use \Exception;
class DatasetObserver
{
@ -92,10 +93,8 @@ class DatasetObserver
// Opus_Search_Service::selectIndexingService('onDocumentChange')
$service = new SolariumAdapter("solr", config('solarium'));
$service->addDatasetsToIndex($dataset);
} catch (Opus_Search_Exception $e) {
Log::debug(__METHOD__ . ': ' . 'Indexing document ' . $datasetId . ' failed: ' . $e->getMessage());
} catch (InvalidArgumentException $e) {
Log::warning(__METHOD__ . ': ' . $e->getMessage());
} catch (Exception $e) {
Log::error(__METHOD__ . ': ' . 'Indexing document ' . $dataset->id . ' failed: ' . $e->getMessage());
}
}
}

10
composer.lock generated
View File

@ -2200,16 +2200,16 @@
},
{
"name": "nesbot/carbon",
"version": "2.48.0",
"version": "2.48.1",
"source": {
"type": "git",
"url": "https://github.com/briannesbitt/Carbon.git",
"reference": "d3c447f21072766cddec3522f9468a5849a76147"
"reference": "8d1f50f1436fb4b05e7127360483dd9c6e73da16"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/d3c447f21072766cddec3522f9468a5849a76147",
"reference": "d3c447f21072766cddec3522f9468a5849a76147",
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/8d1f50f1436fb4b05e7127360483dd9c6e73da16",
"reference": "8d1f50f1436fb4b05e7127360483dd9c6e73da16",
"shasum": ""
},
"require": {
@ -2289,7 +2289,7 @@
"type": "tidelift"
}
],
"time": "2021-05-07T10:08:30+00:00"
"time": "2021-05-26T22:08:38+00:00"
},
{
"name": "nikic/php-parser",

View File

@ -5,7 +5,7 @@ return [
'repository' => [
'host' => env('SOLR_HOST', 'repository.geologie.ac.at'),
'port' => env('SOLR_PORT', '8983'),
'path' => env('SOLR_PATH', '/solr/'),
'path' => env('SOLR_PATH', '/'),
'core' => env('SOLR_CORE', 'rdr_data')
]
],