Author: sevein
Date: Sun Sep 20 07:07:51 2009
New Revision: 3437

Log:
Fix showAsCompoundDigitalObject from QubitInformationObject, which was not 
getting display_as_compound_object property correctly. Added some comments to 
make code more understandable in cases of multi-page documents.

Modified:
   trunk/lib/model/QubitDigitalObject.php
   trunk/lib/model/QubitInformationObject.php

Modified: trunk/lib/model/QubitDigitalObject.php
==============================================================================
--- trunk/lib/model/QubitDigitalObject.php      Sun Sep 20 06:16:43 2009        
(r3436)
+++ trunk/lib/model/QubitDigitalObject.php      Sun Sep 20 07:07:51 2009        
(r3437)
@@ -268,12 +268,12 @@
         // display as compound object (with pager)
         $this->createCompoundChildren();
 
-        if (null !== $parentDigitalObject = $this->getParent())
-        {
-          
$parentDigitalObject->getInformationObject()->setDisplayAsCompoundObject(1);
-        }
+        // Set parent digital object to be displayed as compound
+        $this->getInformationObject()->setDisplayAsCompoundObject(1);
 
-        $this->createRepresentations(QubitTerm::MASTER_ID);
+        // We don't need reference image because a compound will be displayed 
instead of it
+        // But thumbnails are necessary for image flow
+        $this->createThumbnail();
       }
       else
       {

Modified: trunk/lib/model/QubitInformationObject.php
==============================================================================
--- trunk/lib/model/QubitInformationObject.php  Sun Sep 20 06:16:43 2009        
(r3436)
+++ trunk/lib/model/QubitInformationObject.php  Sun Sep 20 07:07:51 2009        
(r3437)
@@ -1196,7 +1196,7 @@
     }
 
     // Return false if "show compound" toggle is not set to '1' (yes)
-    $showCompoundProp = QubitProperty::getOneByObjectIdAndName($this->getId(), 
'display_as_compound_object');
+    $showCompoundProp = QubitProperty::getOneByObjectIdAndName($this->getId(), 
'display_as_compound_object', array('scope' => 'information_object'));
     if (null === $showCompoundProp || '1' != 
$showCompoundProp->getValue(array('sourceCulture' => true)) )
     {
       return false;

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.ca/group/qubit-commits?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to