Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX] Fix warnings for undefined array keys in Mods class #1227

Merged
merged 6 commits into from
May 30, 2024
Merged
4 changes: 2 additions & 2 deletions Classes/Format/Mods.php
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ private function getPlaces(): void
if (!empty($places)) {
foreach ($places as $place) {
$this->metadata['place'][] = $place;
if (!$this->metadata['place_sorting'][0]) {
if (empty($this->metadata['place_sorting'][0])) {
$this->metadata['place_sorting'][0] = preg_replace('/[[:punct:]]/', '', $place);
}
}
Expand Down Expand Up @@ -363,7 +363,7 @@ private function getYears(): void
$issued = $year->getIssuedDates();
if (!empty($issued)) {
$this->metadata['year'][] = $issued[0]->getValue();
if (!$this->metadata['year_sorting'][0]) {
if (empty($this->metadata['year_sorting'][0])) {
$yearSorting = str_ireplace('x', '5', preg_replace('/[^\d.x]/i', '', $issued[0]->getValue()));
if (
strpos($yearSorting, '.')
Expand Down