[+FEATURE] Extbase (Dispatcher): dispatcher::extractStoragePageId() now takes pages...
[Packages/TYPO3.CMS.git] / typo3 / sysext / extbase / Classes / Dispatcher.php
index d7fd737..7ac34a1 100644 (file)
@@ -85,7 +85,8 @@ class Tx_Extbase_Dispatcher {
 
        /**
         * Extracts the storage PID from $this->cObj->data['pages']. ONLY ALLOWS ONE STORAGE PID!
-        * If this one is empty, tries to use $this->cObj->parentRecord->data['storage_pid']. If both are empty, uses current page.
+        * If this one is empty, tries to use $this->cObj->data['storage_pid'].  
+        * If this one is empty, tries to use $this->cObj->parentRecord->data['storage_pid']. If all tree  are empty, uses current page.
         * 
         * @return integer
         * @throws InvalidArgumentException if more than one storage page ID is given
@@ -97,6 +98,10 @@ class Tx_Extbase_Dispatcher {
                        }
                        return (int)$this->cObj->data['pages'];
                }
+
+               if ($this->cObj->data['storage_pid'] > 0) {
+                       return (int)$this->cObj->data['storage_pid'];
+               }
                
                if ($this->cObj->parentRecord->data['storage_pid'] > 0) {
                        return (int)$this->cObj->parentRecord->data['storage_pid'];