mirror of
https://github.com/silverstripe/silverstripe-dms
synced 2024-10-22 14:05:56 +02:00
BUG: Share session namespace with CMS main when adding documents.
The changes to the session management in 3.1 mean that editing when uploading a document no longer worked as the page ID was not correctly managed in the session. This addresses that issue by sharing a session state with CMSMain.
This commit is contained in:
parent
f718b90b69
commit
893c10955a
@ -7,6 +7,8 @@ class DMSDocumentAddController extends LeftAndMain {
|
||||
private static $required_permission_codes = 'CMS_ACCESS_AssetAdmin';
|
||||
private static $menu_title = 'Edit Page';
|
||||
private static $tree_class = 'SiteTree';
|
||||
private static $session_namespace = 'CMSMain';
|
||||
|
||||
static $allowed_extensions = array();
|
||||
|
||||
private static $allowed_actions = array (
|
||||
@ -44,15 +46,7 @@ class DMSDocumentAddController extends LeftAndMain {
|
||||
* Return fake-ID "root" if no ID is found (needed to upload files into the root-folder)
|
||||
*/
|
||||
public function currentPageID() {
|
||||
if(is_numeric($this->request->requestVar('ID'))) {
|
||||
return $this->request->requestVar('ID');
|
||||
} elseif (is_numeric($this->urlParams['ID'])) {
|
||||
return $this->urlParams['ID'];
|
||||
} elseif(Session::get("{$this->class}.currentPage")) {
|
||||
return Session::get("{$this->class}.currentPage");
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
return ($result = parent::currentPageID()) === null ? 0 : $result;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user