diff --git a/src/Controller/ArcheApiController.php b/src/Controller/ArcheApiController.php index 10e0d65..997fafd 100644 --- a/src/Controller/ArcheApiController.php +++ b/src/Controller/ArcheApiController.php @@ -498,8 +498,7 @@ public function repo_getRelatedPublicationsResources(string $repoid, string $lng $this->result = $this->helper->createView($this->modelData, 'getRPR', $this->siteLang); $response->setStatusCode(200); - - } catch(\Exception $ex) { + } catch (\Exception $ex) { $response->setStatusCode(400); $this->result = $ex->getMessage(); } @@ -520,9 +519,9 @@ public function repo_getRelatedPublicationsResourcesAjax(string $repoid, string $response = new Response(); $obj = $this->createDbHelperObject( - array('fieldOrder' => true, 'repoid' => $repoid, + array('fieldOrder' => true, 'repoid' => $repoid, 'lang' => $lng, 'limit' => $limit, 'page' => $page, 'order' => $order, - 'fields' => array('titleasc' => 'title', 'titledesc' => 'title', + 'fields' => array('titleasc' => 'title', 'titledesc' => 'title', 'typeasc' => 'acdhtype', 'typedesc' => 'acdhtype') ) ); diff --git a/src/Controller/DetailViewController.php b/src/Controller/DetailViewController.php index 9cf18ea..1324ac8 100644 --- a/src/Controller/DetailViewController.php +++ b/src/Controller/DetailViewController.php @@ -206,5 +206,4 @@ private function getChildData(): \Symfony\Component\HttpFoundation\Response $child = new \Drupal\acdh_repo_gui\Controller\ChildApiController(); return $child->generateView($this->repoid, '10', '0', 'titleasc'); } - } diff --git a/src/Helper/MetadataGuiHelper.php b/src/Helper/MetadataGuiHelper.php index a66cfa8..d235933 100644 --- a/src/Helper/MetadataGuiHelper.php +++ b/src/Helper/MetadataGuiHelper.php @@ -565,11 +565,11 @@ private function reorderRootTable(array $data) if (isset($v->ordering) && isset($v->uri)) { //handle the duplicated ids - if($v->ordering == 99999) { - if(count($uris) == 0) { - $uris[$v->uri] = $v->ordering; - } else if(count($uris) > 0) { - if(key_exists($v->uri, $uris)) { + if ($v->ordering == 99999) { + if (count($uris) == 0) { + $uris[$v->uri] = $v->ordering; + } elseif (count($uris) > 0) { + if (key_exists($v->uri, $uris)) { $v->ordering = (int)$uris[$v->uri]; } else { $uris[$v->uri] = (int)max(array_keys($this->data)) + 1; diff --git a/src/Model/ArcheApiModel.php b/src/Model/ArcheApiModel.php index 899db05..37ec70c 100644 --- a/src/Model/ArcheApiModel.php +++ b/src/Model/ArcheApiModel.php @@ -442,18 +442,17 @@ private function getRPRAjax(): array * @param type $properties * @return void */ - private function setUpProperties($properties): void { + private function setUpProperties($properties): void + { $this->properties = $properties; - if(isset($this->properties->fieldOrder)) { + if (isset($this->properties->fieldOrder)) { $obj = $this->orderingByFields($this->properties->fields, $this->properties->order); $this->properties->order = $obj->order; $this->properties->property = $obj->property; - }else if(isset($this->properties->order)) { + } elseif (isset($this->properties->order)) { $obj = $this->ordering($this->properties->order); $this->properties->order = $obj->order; $this->properties->property = $obj->property; - } } - }