Skip to content

Commit

Permalink
Merge pull request #436 from OPUS4/4.7.0.7
Browse files Browse the repository at this point in the history
OPUS 4.7.0.7 Patch Release
  • Loading branch information
j3nsch authored Oct 19, 2021
2 parents 4e0b859 + 45ca614 commit 306ae8d
Show file tree
Hide file tree
Showing 12 changed files with 107 additions and 10 deletions.
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# OPUS 4 Change Log

## Release 4.7.0.7 - 2021-10-19

### Bugs

* [OPUSVIER-4563] - OAI-PMH: Deklaration von xmlns:xsi XMLSchema-instance fehlt auf Folgeseiten
* GH-377 - Nach erfolgreicher Änderung eines Passworts erscheint Fehlermeldung und keine Bestätigungsmeldung
---

## Release 4.7.0.6 - 2021-09-28
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ redevelopment that was created as part of a DFG ([Deutsche Forschungsgemeinschaf
Since then the development has been continued at KOBV ([Kooperativer Bibliotheksverbund Berlin-Brandenburg][KOBV])
mostly.

## OPUS 4.7.0.6 (current version)
## OPUS 4.7.0.7 (current version)

The current version of OPUS 4 is __4.7__.0.6. It is available on the [master][MASTER] branch.
The current version of OPUS 4 is __4.7__.0.7. It is available on the [master][MASTER] branch.

[Documentation][DOC]
: Information on setting up a repository, for users and administrators.
Expand Down
24 changes: 21 additions & 3 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
# OPUS 4 Release Notes

## Release 4.7.0.6 2021-09-28
---

## Patch Release 4.7.0.7 2021-10-19

Die Deklaration des Namespaces "xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
erfolgt nun auch in jedem Metadata-Element der mit einem Resumption-Token abgerufenen
Folgeseiten eines OAI-Exports.

Außerdem wurde ein kleiner Fehler im User Interface behoben.

---

## Patch Release 4.7.0.6 2021-09-28

Dieser Patch Release behebt Problem bei XMetaDissPlus und beim
Freischalten von Dokumenten im Review-Modul.
Expand All @@ -27,7 +39,9 @@ bisher immer das Feld `PublishedDate` auf das aktuelle Datum gesetzt.
Mit der neuen Version werden existierende Einträge in dem Feld nicht
mehr überschrieben.

## Release 4.7.0.5 2021-08-17
---

## Patch Release 4.7.0.5 2021-08-17

Dieser Patch Release behebt zwei kleinere Bugs. Das Editieren der Inhalte der
Impressum und Kontakt-Seite ist nun auch von der FAQ-Seite aus ohne Probleme beim
Expand All @@ -39,7 +53,9 @@ insbesondere auch mit Namen, die Bindestriche enthalten.
Die Deklaration des Namespaces "xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
erfolgt nun beim OAI-Export in jedem Metadata Wurzel Element (GH-412).

## Release 4.7.0.4 2020-12-02
---

## Patch Release 4.7.0.4 2020-12-02

Diese Version behebt einen Bug im Framework bei der Abfrage, wenn in einem Dokument
mehrere Identifier vom gleichen Typ vorhanden sind. Dieses Problem hat in einem Fall
Expand All @@ -53,6 +69,8 @@ Die Versionen 4.7.0.1-4.7.0.3 wurden als kleine Patch-Releases veröffentlicht,
die Versionsnummer von OPUS 4 zu verändern. In Zukunft werden wir auch für diese
Patch-Releases die Versionsnummer aktualisieren.

---

## Release 4.7 2020-07-31

Die Änderungen in OPUS __4.7__, die hier aufgeführt sind, ergänzen was schon für
Expand Down
2 changes: 1 addition & 1 deletion application/configs/application.ini
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ name = 'OPUS 4'
logoLink = home
security = 1
workspacePath = APPLICATION_PATH "/workspace"
version = 4.7.0.6
version = 4.7.0.7
update.latestVersionCheckUrl = "https://api.github.com/repos/opus4/application/releases/latest"
; base URL of your OPUS instance (used for generating absolute URLs, e.g. in email messages)
url = 'https://web.example.org/opus'
Expand Down
2 changes: 2 additions & 0 deletions modules/account/controllers/IndexController.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ public function saveAction()

if ($isLoginChanged || $isPasswordChanged) {
Zend_Auth::getInstance()->clearIdentity();
$this->_helper->redirector->redirectToAndExit('index', 'account_password_change_success', 'index', 'auth');
return;
}
} else {
$actionUrl = $this->view->url(['action' => 'save']);
Expand Down
9 changes: 9 additions & 0 deletions modules/account/language/account.tmx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@
</tuv>
</tu>

<tu tuid="account_password_change_success">
<tuv xml:lang="en">
<seg>Your password was changed successfully. Please login again.</seg>
</tuv>
<tuv xml:lang="de">
<seg>Ihr Passwort wurde erfolgreich geändert. Bitte erneut einloggen.</seg>
</tuv>
</tu>

</body>

</tmx>
8 changes: 8 additions & 0 deletions modules/oai/models/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,11 @@ protected function handleRequestIntern(array $oaiRequest, $requestUri)

$doc = $this->_proc->transformToDoc($this->_xml);

// Requests with resumptionToken do not provide metadataPrefix in the URL
if ($metadataPrefix === null && isset($oaiRequest['metadataPrefixMode'])) {
$metadataPrefix = $oaiRequest['metadataPrefixMode'];
}

// TODO is this something that should happen for all metadataPrefixes (OPUSVIER-4531)
$metadataPrefixTags = [
'oai_dc' => 'dc',
Expand Down Expand Up @@ -483,7 +488,10 @@ private function _handlingOfLists(array &$oaiRequest, $maxRecords)
$restIds = $token->getDocumentIds();
$metadataPrefix = $token->getMetadataPrefix();

$oaiRequest['metadataPrefix'] = $metadataPrefix;
$oaiRequest['metadataPrefixMode'] = strtolower($metadataPrefix);
$this->_proc->setParameter('', 'oai_metadataPrefix', $metadataPrefix);

$resumed = true;
} else {
// no resumptionToken is given
Expand Down
54 changes: 54 additions & 0 deletions tests/modules/oai/format/DcTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,60 @@ public function testXmlXsiSchemaDeclarationPresentForDcMetadata()
}
}

public function testListRecordsMetadataSchemaWithResumptionToken()
{
$max_records = '2';

Zend_Registry::get('Zend_Config')->merge(
new Zend_Config(['oai' => ['max' => ['listrecords' => $max_records]]])
);

// first request: fetch documents list and expect resumption code
$this->dispatch("/oai?verb=ListRecords&metadataPrefix=oai_dc");
$this->assertResponseCode(200);

$response = $this->getResponse();
$badStrings = ["Exception", "Error", "Stacktrace", "badVerb"];
$this->checkForCustomBadStringsInHtml($response->getBody(), $badStrings);

$xpath = $this->prepareXpathFromResultString($response->getBody());
$recordElements = $xpath->query('//oai:ListRecords/oai:record');
$this->assertEquals($max_records, $recordElements->length);

$rsTokenElement = $xpath->query('//oai:ListRecords/oai:resumptionToken[@cursor="0"]');
$this->assertEquals(1, $rsTokenElement->length, 'foobar');
$rsToken = $rsTokenElement->item(0)->textContent;
$this->assertNotEmpty($rsToken);

// next request: continue document list with resumption token
$this->resetRequest();
$this->dispatch("/oai?verb=ListRecords&resumptionToken=$rsToken");
$this->assertResponseCode(200);

$response = $this->getResponse();
$badStrings = ["Exception", "Stacktrace", "badVerb", "badArgument"];
$this->checkForCustomBadStringsInHtml($response->getBody(), $badStrings);

$xpath = $this->prepareXpathFromResultString($response->getBody());
$recordElements = $xpath->query('//oai:ListRecords/oai:record');
$this->assertEquals($max_records, $recordElements->length);

$rsTokenElement = $xpath->query('//oai:ListRecords/oai:resumptionToken[@cursor="' . $max_records . '"]');
$this->assertEquals(1, $rsTokenElement->length, 'foobar');
$this->registerXpathNamespaces($this->xpathNamespaces);

$this->assertXpath('//oai_dc:dc');

$xml = $this->getResponse()->getBody();

if (preg_match('#<oai_dc:dc.*>#', $xml, $matches)) {
$startTag = $matches[0];
$this->assertContains('xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"', $startTag);
} else {
$this->fail('element \'oai_dc:dc\' not found');
}
}

public function testProblemAssertXPathWithMetadataNamespaceAttributes()
{
$this->markTestSkipped('Test for documenting OAI namespace testing problem.');
Expand Down
2 changes: 1 addition & 1 deletion tests/modules/oai/format/EpicurTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class Oai_Format_EpicurTest extends ControllerTestCase
'marc' => 'http://www.loc.gov/MARC21/slim'
];

public function testXmlXsiSchemaDeclarationPresentForDcMetadata()
public function testXmlXsiSchemaDeclarationPresentForEpicurMetadata()
{
$this->dispatch('/oai?verb=GetRecord&metadataPrefix=epicur&identifier=oai::146');

Expand Down
2 changes: 1 addition & 1 deletion tests/modules/oai/format/Marc21Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class Oai_Format_Marc21Test extends ControllerTestCase
'marc' => 'http://www.loc.gov/MARC21/slim'
];

public function testXmlXsiSchemaDeclarationPresentForDcMetadata()
public function testXmlXsiSchemaDeclarationPresentForMarc21Metadata()
{
$this->dispatch('/oai?verb=GetRecord&metadataPrefix=marc21&identifier=oai::146');

Expand Down
2 changes: 1 addition & 1 deletion tests/modules/oai/format/OaiPpTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class Oai_Format_OaiPpTest extends ControllerTestCase
'PP' => 'http://www.proprint-service.de/xml/schemes/v1/CHECKED'
];

public function testXmlXsiSchemaDeclarationPresentForDcMetadata()
public function testXmlXsiSchemaDeclarationPresentForOaiPpMetadata()
{
$this->dispatch('/oai?verb=GetRecord&metadataPrefix=oai_pp&identifier=oai::146');

Expand Down
2 changes: 1 addition & 1 deletion tests/modules/oai/format/XMetaDissPlusTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class Oai_Format_XMetaDissPlusTest extends ControllerTestCase
'PP' => 'http://www.proprint-service.de/xml/schemes/v1/CHECKED'
];

public function testXmlXsiSchemaDeclarationPresentForDcMetadata()
public function testXmlXsiSchemaDeclarationPresentForXMetaDissPlusMetadata()
{
$this->dispatch('/oai?verb=GetRecord&metadataPrefix=XMetaDissPlus&identifier=oai::146');

Expand Down

0 comments on commit 306ae8d

Please sign in to comment.