Skip to content

Commit

Permalink
[SYNC] [FAU-291] Fix fatal error on data mirroring if location is emp…
Browse files Browse the repository at this point in the history
…ty (#95)
  • Loading branch information
inpsyde-deploybot committed Jun 6, 2023
1 parent afe54b2 commit 5bbcc52
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/Infrastructure/Search/FilterablePostsMetaUpdater.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,22 +80,21 @@ private function updateForLanguage(string $languageCode, DegreeProgramViewRaw $r
$rawView->degree()->name()->asString($languageCode)
);

/** @var ?MultilingualString $start */
$start = $rawView->start()->offsetGet(0);

if ($start) {
if ($rawView->start()->offsetExists(0)) {
update_post_meta(
$rawView->id()->asInt(),
DegreeProgram::START . '_' . $languageCode,
$start->asString($languageCode),
$rawView->start()->offsetGet(0)->asString($languageCode),
);
}

update_post_meta(
$rawView->id()->asInt(),
DegreeProgram::LOCATION . '_' . $languageCode,
$rawView->location()->offsetGet(0)->asString($languageCode)
);
if ($rawView->location()->offsetExists(0)) {
update_post_meta(
$rawView->id()->asInt(),
DegreeProgram::LOCATION . '_' . $languageCode,
$rawView->location()->offsetGet(0)->asString($languageCode)
);
}

$admissionRequirement = AdmissionRequirementsTranslated::fromAdmissionRequirements(
$rawView->admissionRequirements(),
Expand Down

0 comments on commit 5bbcc52

Please sign in to comment.