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 May 4, 2023
2 parents 6c01153 + d1a5132 commit 18b8d66
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 21 deletions.
5 changes: 1 addition & 4 deletions src/Controller/DetailViewController.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ public function detailOverviewApi(string $identifier, string $lang): Response

$diss = $this->generalFunctions->getDissServices($id);

if(count($result) === 0) {
if (count($result) === 0) {
return new Response(\json_encode(array("There is no data")), 404, ['Content-Type' => 'application/json']);
}

Expand All @@ -263,8 +263,5 @@ public function detailOverviewApi(string $identifier, string $lang): Response


return new Response(render($build));

}


}
2 changes: 0 additions & 2 deletions src/Controller/RootViewController.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
*/
class RootViewController extends \Drupal\acdh_repo_gui\Controller\ArcheBaseController
{

public function __construct()
{
parent::__construct();
Expand Down Expand Up @@ -37,5 +36,4 @@ public function generateView(string $order = "datedesc", string $limit = "10", s
'#cache' => ['max-age' => 0]
];
}

}
21 changes: 10 additions & 11 deletions src/Helper/DetailViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,20 @@ public function createView(array $data = array()): array
* @param string $id
* @return array
*/
public function overviewObj(string $id): array {
public function overviewObj(string $id): array
{
$client = new \GuzzleHttp\Client();
try {
$response = $client->get(str_replace('/api/', '', $this->repoDb->getBaseUrl()).'/browser/api/overview/'.$id.'/en');
$response = $client->get(str_replace('/api/', '', $this->repoDb->getBaseUrl()).'/browser/api/overview/'.$id.'/en');


$data = json_decode($response->getBody(), TRUE);
$this->data = json_decode(json_encode($data));
$this->extendActualObj();
$this->detailViewObjectArray[] = new ResourceObject($this->data, $this->repoDb, $this->siteLang);
$data = json_decode($response->getBody(), true);
$this->data = json_decode(json_encode($data));
$this->extendActualObj();
$this->detailViewObjectArray[] = new ResourceObject($this->data, $this->repoDb, $this->siteLang);
} catch (\GuzzleHttp\Exception\RequestException $e) {
return [];
}
catch (\GuzzleHttp\Exception\RequestException $e) {
return [];
}
return $this->detailViewObjectArray;
return $this->detailViewObjectArray;
}
}
1 change: 0 additions & 1 deletion src/Model/ArcheModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ public function setSqlTimeout(string $timeout = '7000')
} catch (\Drupal\Core\Database\DatabaseExceptionWrapper $ex) {
\Drupal::logger('acdh_repo_gui')->notice($ex->getMessage());
}

}

/**
Expand Down
1 change: 0 additions & 1 deletion src/Model/DetailViewModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ public function getViewData(string $identifier = ""): array

public function getViewDataLib(string $identifier = ""): object
{

if (empty($identifier)) {
return array();
}
Expand Down
1 change: 0 additions & 1 deletion src/Model/GeneralFunctionsModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ private function getRepoIdBySpecialID(): array
);

$this->sqlResult = $query->fetchAll();

} catch (\Exception $ex) {
\Drupal::logger('acdh_repo_gui')->notice($ex->getMessage());
return array();
Expand Down
1 change: 0 additions & 1 deletion src/Model/SearchViewModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
*/
class SearchViewModel extends ArcheModel
{

private $sqlResult;
private $siteLang;
private $searchCfg;
Expand Down

0 comments on commit 18b8d66

Please sign in to comment.