mirror of
https://github.com/silverstripe/silverstripe-dms
synced 2024-10-22 14:05:56 +02:00
BUG: Fix access to documents on the staging site.
The DMS document controller had been changed to subclass ContentController to correctly initialise the versioned stage. However, this had the side effect of preventing access to documents when the "Stage" stage was selected. ContentController::init() calls the SiteTree::canViewStage() method, which controls access when on the stage. However, since the data record was non-existant, the method would always return false, preventing access to documents. This fix removes the subclassing of ContentController and just directly initialises the versioned stage.
This commit is contained in:
parent
e6925ef912
commit
00bffb2548
@ -804,7 +804,7 @@ class DMSDocument extends DataObject implements DMSDocumentInterface {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class DMSDocument_Controller extends ContentController {
|
class DMSDocument_Controller extends Controller {
|
||||||
|
|
||||||
static $testMode = false; //mode to switch for testing. Does not return document download, just document URL
|
static $testMode = false; //mode to switch for testing. Does not return document download, just document URL
|
||||||
|
|
||||||
@ -812,6 +812,11 @@ class DMSDocument_Controller extends ContentController {
|
|||||||
'index'
|
'index'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
public function init() {
|
||||||
|
Versioned::choose_site_stage();
|
||||||
|
parent::init();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the document object from the request object's ID parameter.
|
* Returns the document object from the request object's ID parameter.
|
||||||
* Returns null, if no document found
|
* Returns null, if no document found
|
||||||
|
Loading…
Reference in New Issue
Block a user