Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

BUGFIX: Fixed ModelAdmin not working when managed models was defined …

…as an array.
  • Loading branch information...
commit b7ce610933a376f4b47a06e2218364c22c6b2b19 1 parent 497aa9b
@ajshort ajshort authored
Showing with 7 additions and 3 deletions.
  1. +7 −3 admin/code/ModelAdmin.php
View
10 admin/code/ModelAdmin.php
@@ -96,14 +96,18 @@
/**
* Initialize the model admin interface. Sets up embedded jquery libraries and requisite plugins.
- *
- * @todo remove reliance on urlParams
*/
public function init() {
parent::init();
$models = $this->getManagedModels();
- $this->modelClass = (isset($this->urlParams['ModelClass'])) ? $this->urlParams['ModelClass'] : key($models);
+
+ if($this->request->param('ModelClass')) {
+ $this->modelClass = $this->request->param('ModelClass');
+ } else {
+ reset($models);
+ $this->modelClass = key($models);
+ }
// security check for valid models
if(!array_key_exists($this->modelClass, $models)) {
Please sign in to comment.
Something went wrong with that request. Please try again.