kitodo/kitodo-presentation

[BUG] Get METS url with newest presentation version

Closed this issue · 3 comments

Description

With presentation 3.3 there was a variable called $uid stored in a Document object. It holds the UID (solr indexed) or the URL (mets) of the document.
Now with presentation 4.x the mentioned variable is empty for all METS files I've tested (around 30) or any solr indexed documents.

Is this on purpose or a bug? If on purpose, what would be the correct way to get the url?

Reproduction

Try any METS files and check if $doc->uid (for PageView) or $this->document->getDoc() (PageViewController) is empty or not.
Example: https://digital.slub-dresden.de/oai/?verb=GetRecord&metadataPrefix=mets&identifier=oai:de:slub-dresden:db:id-512520879
But you can try any of those too: https://github.com/UB-Mannheim/kitodo-presentation/wiki/METS-Examples

Environment

  • OS version: Debian
  • RDBMS version: Maria DB
  • Apache Solr version: -
  • TYPO3 version: 10.4.37
  • PHP version: 7.4.33

Btw.: I went back till 6074cdf from Mar. 2022 and the variable (and some more) is still empty. So maybe its since the Extbase/Fluid transition.

As I have suspected, this issue appears after the Extbase/fluid transition ce36746 .

I digged a bit deeper. Prior to v4.x the construct function of Document set the $uid var up. With v4.x the code moved to individual functions (one of those init($location)).
Furthermore the $location parameter of the construct function in Doc was in every test empty.

Then I realized that somehow I missed, that there is no $uid var any more in v.4.x even though a var_dump of the document object has it (even if its null) and its still referenced in the code (btw. adding type declarations would stop at those points).

Closed this, because while it is true, that uid and location are no longer properties of Doc class, this is an intentional change. Those properties were moved to DocumentRepository and can be accessed there.