Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/Form/LibraryForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,15 @@ public function form(FormBuilderInterface $builder, array $options) : void
FormData::persistTemporaryTranslation($address->getTranslations(), $langcode);
}
} else {
// Rarely an existing library without an address is found. If
// this is the case then the default language code needs to be
// set from the library otherwise the address insertion will fail.
$address = $data->getAddress();

if($address && !$address->getDefaultLangcode()) {
$address->setDefaultLangcode($data->getDefaultLangcode());
}

$mail_address = $data->getMailAddress();

if($mail_address && !$mail_address->getDefaultLangcode()) {
Expand Down