|
@@ -28,14 +28,24 @@ class SelectedSiteController extends ActionController
|
|
|
*/
|
|
*/
|
|
|
protected $currentRootUid;
|
|
protected $currentRootUid;
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * [FOR TESTS ONLY]
|
|
|
|
|
+ */
|
|
|
|
|
+ protected $preventPropagation = false;
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ *
|
|
|
|
|
+ * @throws \TYPO3\CMS\Extbase\Mvc\Exception\StopActionException
|
|
|
|
|
+ */
|
|
|
protected function callActionMethod() {
|
|
protected function callActionMethod() {
|
|
|
|
|
|
|
|
// Check if the current be-user has a db_mountpoint, and only has one.
|
|
// Check if the current be-user has a db_mountpoint, and only has one.
|
|
|
// If so, this will be considered as the selected site (since its the only one available)
|
|
// If so, this will be considered as the selected site (since its the only one available)
|
|
|
- $mp = $GLOBALS['BE_USER']->user['db_mountpoints'];
|
|
|
|
|
|
|
+ $mountpoints = $GLOBALS['BE_USER']->returnWebmounts();
|
|
|
|
|
+ $mountpoints = array_filter($mountpoints, function($m) { return $m != 0; });
|
|
|
|
|
|
|
|
- if ($mp && count(explode(',', $mp)) === 1) {
|
|
|
|
|
- $this->currentRootUid = (int)$mp;
|
|
|
|
|
|
|
+ if ($mountpoints && count($mountpoints) === 1) {
|
|
|
|
|
+ $this->currentRootUid = (int)$mountpoints[0];
|
|
|
} else {
|
|
} else {
|
|
|
// No db mountpoint has been set up, or more than one.
|
|
// No db mountpoint has been set up, or more than one.
|
|
|
// Now we check if a site's page is selected
|
|
// Now we check if a site's page is selected
|
|
@@ -52,6 +62,8 @@ class SelectedSiteController extends ActionController
|
|
|
$this->forward('displayNoSelectedPageWarning', 'SelectedSite', 'OtCore');
|
|
$this->forward('displayNoSelectedPageWarning', 'SelectedSite', 'OtCore');
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ if ($this->preventPropagation) { return; }
|
|
|
|
|
+
|
|
|
parent::callActionMethod();
|
|
parent::callActionMethod();
|
|
|
}
|
|
}
|
|
|
|
|
|