Skip to content

Commit

Permalink
Merge branch 'master' into fix-settings
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastian-meyer committed May 30, 2024
2 parents f90021d + cb9d2c8 commit b9b4096
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
5 changes: 1 addition & 4 deletions Classes/Controller/ListViewController.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,7 @@ public function mainAction(): void
}

// Get current page from request data because the parameter is shared between plugins
$currentPage = $this->requestData['page'];
if (empty($currentPage)) {
$currentPage = 1;
}
$currentPage = $this->requestData['page'] ?? 1;

// get all sortable metadata records
$sortableMetadata = $this->metadataRepository->findByIsSortable(true);
Expand Down
5 changes: 1 addition & 4 deletions Classes/Controller/PageGridController.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,7 @@ public function mainAction(): void
}

// Get current page from request data because the parameter is shared between plugins
$currentPage = $this->requestData['page'];
if (empty($currentPage)) {
$currentPage = 1;
}
$currentPage = $this->requestData['page'] ?? 1;

$itemsPerPage = $this->settings['paginate']['itemsPerPage'];
if (empty($itemsPerPage)) {
Expand Down
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

0 comments on commit b9b4096

Please sign in to comment.