port fix field no-source not pushed to writer

This commit is contained in:
aina-esokia
2019-07-05 12:16:12 +04:00
parent f8f2221910
commit a11e230ded

View File

@@ -121,7 +121,7 @@ class WriteMetadataJob extends AbstractJob
$fieldName = $fieldStructure->get_name();
// skip fields with no src
if($tagName == '') {
if($tagName == '' || $tagName == 'Phraseanet:no-source') {
continue;
}
@@ -139,13 +139,13 @@ class WriteMetadataJob extends AbstractJob
if ($fieldStructure->is_multi()) {
$values = array();
foreach ($fieldValues as $value) {
$values[] = $value->getValue();
$values[] = $this->removeNulChar($value->getValue());
}
$value = new Value\Multi($values);
} else {
$fieldValue = array_pop($fieldValues);
$value = $fieldValue->getValue();
$value = $this->removeNulChar($fieldValue->getValue());
$value = new Value\Mono($value);
}
@@ -215,4 +215,9 @@ class WriteMetadataJob extends AbstractJob
return false;
}
private function removeNulChar($value)
{
return str_replace("\0", "", $value);
}
}