Skip to content

Commit 8e85a1b

Browse files
committed
Some versions of SS dont have getsetResponse
1 parent 267856b commit 8e85a1b

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

code/Extensions/MasqueradeSecurityAdminExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public function updateEditForm($form)
1111
new GridFieldMasqueradeButton()
1212
)
1313
->getComponentByType('GridFieldDetailForm')
14-
->setItemRequestClass('MasqueradeGridFieldDetailForm_ItemRequest')
14+
->setItemRequestClass('MasqueradeGridFieldDetailForm_ItemRequest')
1515
;
1616
}
1717

code/controllers/MasqueradeSecurityController.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,26 @@ public function logout($redirect = true)
2323
}
2424
}
2525

26+
/**
27+
* Returns the SS_HTTPResponse object that this controller is building up.
28+
* Can be used to set the status code and headers
29+
*/
30+
public function getResponse() {
31+
if (!$this->response) {
32+
$this->setResponse(new SS_HTTPResponse());
33+
}
34+
return $this->response;
35+
}
36+
37+
/**
38+
* Sets the SS_HTTPResponse object that this controller is building up.
39+
*
40+
* @param SS_HTTPResponse $response
41+
* @return Controller
42+
*/
43+
public function setResponse(SS_HTTPResponse $response) {
44+
$this->response = $response;
45+
return $this;
46+
}
47+
2648
}

0 commit comments

Comments
 (0)