mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-10 11:33:17 +00:00
Fix uncaught Exception in caption_field_value creation
This commit is contained in:
@@ -264,8 +264,13 @@ class caption_Field_Value implements cache_cacheableInterface
|
|||||||
|
|
||||||
// Check consistency
|
// Check consistency
|
||||||
if (! $databox_field->is_multi()) {
|
if (! $databox_field->is_multi()) {
|
||||||
$field = $record->get_caption()->get_field($databox_field->get_name());
|
try {
|
||||||
$values = $field->get_values();
|
$field = $record->get_caption()->get_field($databox_field->get_name());
|
||||||
|
$values = $field->get_values();
|
||||||
|
} catch (Exception $exception) {
|
||||||
|
// Field was not found, so no values found either
|
||||||
|
$values = [];
|
||||||
|
}
|
||||||
if (! empty($values)) {
|
if (! empty($values)) {
|
||||||
$caption_field_value = array_pop($values);
|
$caption_field_value = array_pop($values);
|
||||||
/* @var \caption_Field_Value $caption_field_value */
|
/* @var \caption_Field_Value $caption_field_value */
|
||||||
|
Reference in New Issue
Block a user