Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issueContent without prior call to getContentMetadata #18

Open
jabbors opened this issue Jan 16, 2017 · 0 comments
Open

issueContent without prior call to getContentMetadata #18

jabbors opened this issue Jan 16, 2017 · 0 comments

Comments

@jabbors
Copy link
Member

jabbors commented Jan 16, 2017

It appears some reading devices (Victor Stream Reader and Webbox2) caches the result from getContentMetadata for optimization, so in some cases there might be a call to issueContent without a prior call to getContentMetatdata.

Although the specification clearly states that getContentMetadata must be called, it is arguable if it's necessary or not.

The intention of Kolibre-KADOS is to be 100% fully compatible with the written standard. Hence it is enforced that a reading system always calls getContentMetadata before issueContent.

However, it can be disabled with the below change to the source code.

diff --git a/include/DaisyOnlineService.class.php b/include/DaisyOnlineService.class.php
index 4548fa3..c426757 100644
--- a/include/DaisyOnlineService.class.php
+++ b/include/DaisyOnlineService.class.php
@@ -768,12 +768,12 @@ class DaisyOnlineService
         }
 
         // check if a prior call to getContentMetadata has been made
-        if (!$this->sessionHandleDisabled && in_array($contentId, $this->sessionContentMetadataRequests) === false)
-        {
-            $this->logger->warn("No prior call to getContentMetadata for content '$contentId'");
-            $faultString = "Metadata for content has not been requested, call getContentMetadata for content '$contentId'";
-            throw new SoapFault('Client', $faultString, '', '', 'issueContent_invalidOperationFault');
-        }
+        // if (!$this->sessionHandleDisabled && in_array($contentId, $this->sessionContentMetadataRequests) === false)
+        // {
+        //     $this->logger->warn("No prior call to getContentMetadata for content '$contentId'");
+        //     $faultString = "Metadata for content has not been requested, call getContentMetadata for content '$contentId'";
+        //     throw new SoapFault('Client', $faultString, '', '', 'issueContent_invalidOperationFault');
+        // }
 
         // check if content is issuable and issue content
         try
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant