mirror of
https://github.com/processwire/processwire.git
synced 2025-08-17 12:10:45 +02:00
Fix issue processwire/processwire-issues#489 where file/image field with limit=1, multi-language description was not retained on when file was replaced
This commit is contained in:
@@ -697,8 +697,22 @@ class InputfieldFile extends Inputfield implements InputfieldItemList, Inputfiel
|
||||
*
|
||||
*/
|
||||
protected function ___extractMetadata(Pagefile $pagefile, array $metadata = array()) {
|
||||
|
||||
$metadata['description'] = $pagefile->description;
|
||||
|
||||
/** @var Languages $languages */
|
||||
$languages = $this->wire('languages');
|
||||
if($languages && !$this->noLang) {
|
||||
foreach($languages as $language) {
|
||||
if($language->isDefault()) continue;
|
||||
$metadata["description$language->id"] = $pagefile->description($language);
|
||||
}
|
||||
}
|
||||
|
||||
$metadata['tags'] = $pagefile->tags;
|
||||
$filedata = $pagefile->filedata();
|
||||
if(count($filedata)) $metadata['filedata'] = $filedata;
|
||||
|
||||
return $metadata;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user