Browse files

ENHANCEMENT Setting $this->request in ModelAdmin_RecordController->ed…

…it() instead of returning new response, so it can be altered by subclasses

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@114144 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
1 parent c579822 commit 65b3b145f1fbc883f88ff3c48a64a520e61802dc @chillu chillu committed Nov 24, 2010
Showing with 3 additions and 3 deletions.
  1. +3 −3 code/ModelAdmin.php
View
6 code/ModelAdmin.php
@@ -913,22 +913,22 @@ public function Link($action = null) {
function edit($request) {
if ($this->currentRecord) {
if($this->isAjax()) {
- return new SS_HTTPResponse(
- $this->EditForm()->formHtmlContent(),
+ $this->response->setBody($this->EditForm()->formHtmlContent());
+ $this->response->setStatusCode(
200,
sprintf(
_t('ModelAdmin.LOADEDFOREDITING', "Loaded '%s' for editing."),
$this->currentRecord->Title
)
);
+ return $this->response;
} else {
// This is really quite ugly; to fix will require a change in the way that customise() works. :-(
return $this->parentController->parentController->customise(array(
'Right' => $this->parentController->parentController->customise(array(
'EditForm' => $this->EditForm()
))->renderWith(array("{$this->class}_right",'LeftAndMain_right'))
))->renderWith(array('ModelAdmin','LeftAndMain'));
- return ;
}
} else {
return _t('ModelAdmin.ITEMNOTFOUND', "I can't find that item");

0 comments on commit 65b3b14

Please sign in to comment.