Skip to content

Commit 48cf68c

Browse files
Merge pull request #36 from lepidus/stable-3_3_0
Feature/use ROR ID to assign Thoth affiliations
2 parents d9d643f + bf97661 commit 48cf68c

7 files changed

Lines changed: 10 additions & 7 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ This is required to use the API credentials provided, that are stored encrypted
3434

3535
- Only basic HTML tags are preserved (`<strong>`, `<mark>`, `<em>`, `<i>`, `<u>`, `<sup>`, `<sub>`, `<ul>`, `<ol>` and `<li>`); all others will be removed
3636
- ISBN must be properly formatted (e.g., 978-3-16-148410-0)
37+
- To avoid incorrect assignment of affiliations in Thoth, is required the use of the [ROR plugin](https://github.com/withanage/ror) to fill the affiliations in OMP.
3738

3839
### Configuration
3940

classes/services/ThothAffiliationService.inc.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ public function __construct($repository)
2424
$this->repository = $repository;
2525
}
2626

27-
public function register($affiliation, $thothContributionId)
27+
public function register($rorId, $thothContributionId)
2828
{
29-
$thothInstitution = ThothRepo::institution()->find($affiliation);
29+
$thothInstitution = ThothRepo::institution()->find($rorId);
3030

3131
if ($thothInstitution === null) {
3232
return null;

classes/services/ThothContributionService.inc.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ public function register($author, $thothWorkId, $primaryContactId = null)
4444

4545
$thothContributionId = $this->repository->add($thothContribution);
4646

47-
if ($affiliation = $author->getLocalizedAffiliation()) {
48-
ThothService::affiliation()->register($affiliation, $thothContributionId);
47+
if ($rorId = $author->getData('rorId')) {
48+
ThothService::affiliation()->register($rorId, $thothContributionId);
4949
}
5050

5151
return $thothContributionId;

docs/README-es.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ Esto es necesario para utilizar las credenciales de la API proporcionadas, que s
3434

3535
- Solo se conservan las etiquetas HTML básicas (`<strong>`, `<mark>`, `<em>`, `<i>`, `<u>`, `<sup>`, `<sub>`, `<ul>`, `<ol>` y `<li>`); todas las demás serán eliminadas
3636
- El ISBN debe estar correctamente formateado (por ejemplo, 978-3-16-148410-0)
37+
- Para evitar la asignación incorrecta de afiliaciones en Thoth, se requiere el uso del [plugin ROR](https://github.com/withanage/ror) para completar las afiliaciones en OMP.
3738

3839
### Configuración
3940

docs/README-pt_BR.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ Isso é necessário para usar as credenciais da API fornecidas, que são armazen
3434

3535
- Apenas tags básicas de HTML são preservadas (`<strong>`, `<mark>`, `<em>`, `<i>`, `<u>`, `<sup>`, `<sub>`, `<ul>`, `<ol>` e `<li>`); todas as outras serão removidas
3636
- O ISBN deve estar devidamente formatado (por exemplo, 978-3-16-148410-0)
37+
- Para evitar a atribuição incorreta de afiliações no Thoth, é necessário o uso do [plugin ROR](https://github.com/withanage/ror) para preencher as afiliações no OMP.
3738

3839
### Configuração
3940

tests/classes/services/ThothAffiliationServiceTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ public function testRegisterAffiliation()
5959
->method('add')
6060
->will($this->returnValue('43f98edb-ac8c-45b4-9faa-2941a05c133c'));
6161

62-
$affiliation = 'My Affiliation Institution';
62+
$rorId = 'https://ror.org/00101234';
6363
$thothContributionId = '7315563c-e5c3-40b2-8558-8d1f9cede901';
6464

6565
$service = new ThothAffiliationService($mockRepository);
66-
$thothAffiliationId = $service->register($affiliation, $thothContributionId);
66+
$thothAffiliationId = $service->register($rorId, $thothContributionId);
6767

6868
$this->assertSame('43f98edb-ac8c-45b4-9faa-2941a05c133c', $thothAffiliationId);
6969
}

version.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<version>
44
<application>thoth</application>
55
<type>plugins.generic</type>
6-
<release>0.1.9.0</release>
6+
<release>0.1.10.0</release>
77
<date>2025-05-01</date>
88
<lazy-load>1</lazy-load>
99
<class>ThothPlugin</class>

0 commit comments

Comments
 (0)