Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IE10 & IE11: Bulk editing in ModelAdmin generates an error #104

Open
mlewis-everley opened this issue Jul 15, 2015 · 8 comments
Open

IE10 & IE11: Bulk editing in ModelAdmin generates an error #104

mlewis-everley opened this issue Jul 15, 2015 · 8 comments
Labels

Comments

@mlewis-everley
Copy link
Contributor

When trying to perform any Bulk action (either the included edit, delete, etc) or custom actions.

Trying to trace this myself, but the message I get is:

[User Error] ModelAdmin::init(): Invalid Model class

GET /cots-app/admin/contacts/admin/contacts/Contact/EditForm/field/Contact/bulkAction/bulkEdit?cacheBuster=1436963033676&records[]=5632&records[]=6144&records[]=7424&records[]=7680&records[]=8192&records[]=5633

Line 127 in /home/morven/Projects/cots-app/framework/admin/code/ModelAdmin.php

Source
118 if($this->request->param('ModelClass')) {
119 $this->modelClass = $this->unsanitiseClassName($this->request->param('ModelClass'));
120 } else {
121 reset($models);
122 $this->modelClass = key($models);
123 }
124
125 // security check for valid models
126 if(!array_key_exists($this->modelClass, $models)) {
127 user_error('ModelAdmin::init(): Invalid Model class', E_USER_ERROR);
128 }
129
130 Requirements::javascript(FRAMEWORK_ADMIN_DIR . '/javascript/ModelAdmin.js');
131 }
132
133 public function Link($action = null) {

Trace
•ModelAdmin::init(): Invalid Model class
ModelAdmin.php:127
•ModelAdmin->init()
Controller.php:139
•Controller->handleRequest(SS_HTTPRequest,DataModel)
LeftAndMain.php:443
•LeftAndMain->handleRequest(SS_HTTPRequest,DataModel)
AdminRootController.php:93
•AdminRootController->handleRequest(SS_HTTPRequest,DataModel)
Director.php:370
•Director::handleRequest(SS_HTTPRequest,Session,DataModel)
Director.php:153
•Director::direct(/admin/contacts/admin/contacts/Contact/EditForm/field/Contact/bulkAction/bulkEdit,DataModel)
main.php:177

@colymba
Copy link
Owner

colymba commented Jul 15, 2015

So this is an IE only issue? Works fine in Chrome etc?
Do you mind posting your Contact class definition so I can try and test this locally?

@mlewis-everley
Copy link
Contributor Author

It works fine in Chrome, Safari and Firefox.

I have all the code in my contacts module: https://github.com/i-lateral/silverstripe-contacts That might be easier?

I believe I have attached the gridfield to Model Admin the way I am supposed to?

The problem I get when trying to use edit appears to be that the URL is incorrect, looks like it is directing to /admin/admin...

Hopefully that makes sense?

@mlewis-everley
Copy link
Contributor Author

Actually, I think this might be 2 symptoms of the same issue... I notice the URL for the issue I posted is:

/admin/contacts/admin/contacts/Contact/EditForm/field/Contact/bulkAction/bulkEdit,DataModel

/admin/contacts is being duplicated (in the same way as the edit URL). Not sure why the resulting error is not the same (they should both result in a page not found)?

@colymba
Copy link
Owner

colymba commented Jul 17, 2015

Do you use Fluent or Translatable or anything that adds localisation and a locale in the URL by any chance?

@mlewis-everley
Copy link
Contributor Author

Nope, not that I am aware of anyway :-s

@robbieaverill
Copy link
Contributor

Still an issue @mlewis-everley?

@mlewis-everley
Copy link
Contributor Author

@robbieaverill I am not sure to be honest, this was an SS3 bug haven't really tested SS4 extensively in IE yet.

@sanderha
Copy link

sanderha commented Feb 8, 2019

I'm experiencing this issue with ss 4.3.0 aswell

I suspect the issue might be somewhere in the getActionURL() function, in manager.js

Can confirm does not happen in Edge 17 and 18

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants