Skip to content

Commit

Permalink
Include required schema def in the config
Browse files Browse the repository at this point in the history
as the RepoResource object restored from the cache does not have a Repo
initialized and therefore can not read schema from there
  • Loading branch information
zozlak committed Oct 23, 2024
1 parent 7ca575f commit 52ead58
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ jobs:
docker run -d --name "$RANCHER_NAMESPACE" -v `pwd`/tests/config.yaml:/var/www/html/config.yaml -p 8080:80 "acdhch/$RANCHER_NAMESPACE:latest"
sleep 1
curl -f -i 'http://127.0.0.1:8080/?id=https%3A%2F%2Fhdl.handle.net%2F21.11115%2F0000-000E-5942-4'
curl -f -i 'http://127.0.0.1:8080/?id=https%3A%2F%2Fhdl.handle.net%2F21.11115%2F0000-000E-5942-4'
- name: authorize against docker hub
uses: docker/login-action@v3
with:
Expand Down
3 changes: 3 additions & 0 deletions build/config/arche.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ biblatex:
defaultLang: en
biblatexProperty: https://vocabs.acdh.oeaw.ac.at/schema#hasCustomCitation
etal: etal
schema:
label: https://vocabs.acdh.oeaw.ac.at/schema#hasTitle
parent: https://vocabs.acdh.oeaw.ac.at/schema#isPartOf
mapping:
person:
name: https://vocabs.acdh.oeaw.ac.at/schema#hasFirstName
Expand Down
2 changes: 1 addition & 1 deletion src/acdhOeaw/arche/biblatex/Resource.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ static public function cacheHandler(RepoResourceInterface $res,
public function __construct(RepoResourceInterface $res, object $config,
?LoggerInterface $log = null) {
$this->res = $res;
$this->schema = $res->getRepo()->getSchema();
$this->schema = new Schema($config->schema);
$this->config = $config;
$this->log = $log;
}
Expand Down
3 changes: 3 additions & 0 deletions tests/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ biblatex:
defaultLang: en
biblatexProperty: https://vocabs.acdh.oeaw.ac.at/schema#hasCustomCitation
etal: etal
schema:
label: https://vocabs.acdh.oeaw.ac.at/schema#hasTitle
parent: https://vocabs.acdh.oeaw.ac.at/schema#isPartOf
mapping:
person:
name: https://vocabs.acdh.oeaw.ac.at/schema#hasFirstName
Expand Down

0 comments on commit 52ead58

Please sign in to comment.