Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/acdh-oeaw/arche-gui
Browse files Browse the repository at this point in the history
  • Loading branch information
nczirjak-acdh committed Sep 9, 2021
2 parents 36b1585 + 5fca4e0 commit cb50205
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 15 deletions.
7 changes: 3 additions & 4 deletions src/Controller/ArcheApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand All @@ -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')
)
);
Expand Down
1 change: 0 additions & 1 deletion src/Controller/DetailViewController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

}
10 changes: 5 additions & 5 deletions src/Helper/MetadataGuiHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
9 changes: 4 additions & 5 deletions src/Model/ArcheApiModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

}
}

}

0 comments on commit cb50205

Please sign in to comment.