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

Comments

Projects
None yet
1 participant
@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
You can’t perform that action at this time.