- 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());
}
}
}