Skip to content
Browse files

BUGFIX Type checking in CMS URL params (fixes #7187)

Nasty issue where nested requests to sub-controllers within LeftAndMain->EditForm() would fail because of
LeftAndMain->currentPageID() being taken from the URL, even though it was a field action name.
Example: POST /admin/pages/edit/EditForm/field/MyGridField/item/1/ItemEditForm/field/MyUploadField/upload
The current ID would be detected as "field" in this case.
Bug was previously fixed for AssetAdmin.
  • Loading branch information...
chillu committed Jun 22, 2012
1 parent 3e7bf77 commit ba9c3c7b8e7c8f62e319d3cdb5cc4490b7a62f3b
Showing with 1 addition and 1 deletion.
  1. +1 −1 admin/code/LeftAndMain.php
@@ -1170,7 +1170,7 @@ function getSilverStripeNavigator() {
* @return int
public function currentPageID() {
if($this->request->requestVar('ID')) {
if($this->request->requestVar('ID') && is_numeric($this->request->requestVar('ID'))) {
return $this->request->requestVar('ID');
} elseif (isset($this->urlParams['ID']) && is_numeric($this->urlParams['ID'])) {
return $this->urlParams['ID'];

0 comments on commit ba9c3c7

Please sign in to comment.
You can’t perform that action at this time.