You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When opening the import users or groups from the security admin shows an empty modal.
How to reproduce
Fresh install using silverstripe/installer
Go to the security page in the admin
Click Import CSV from the Users or Groups tab
An empty modal will appear with only the Title showing for each type i.e "Import users" or "Import groups"
Possible Solution
The ModelAdmin ImportForm method checks $importers[$this->modelTab] but the getModelImporters only returns array of import model classes so the isset check is incorrect later.
if (!$importers || !isset($importers[$this->modelTab])) {
could be changed to this if (!$importers || !isset($importers[$this->modelClass])) {
Also the next line would need to change from $importer = $importers[$this->modelTab];
to $importer = $importers[$this->modelClass];
If this looks to be the right path I am happy to make a PR but don't fully understand all of the use cases that I need to account for here.
Additional Context
No response
Validations
Check that there isn't already an issue that reports the same bug
Double check that your reproduction steps work in a fresh installation of silverstripe/installer (with any code examples you've provided)
I can reproduce this locally. Probably the same thing happens for CMS 4 modeladmins that are set up in a similar way.
It seems to be a combination of #1364 reacting poorly with #1657
Module version(s) affected
2.1.14
Description
When opening the import users or groups from the security admin shows an empty modal.
How to reproduce
Possible Solution
The ModelAdmin ImportForm method checks $importers[$this->modelTab] but the getModelImporters only returns array of import model classes so the isset check is incorrect later.
if (!$importers || !isset($importers[$this->modelTab])) {
could be changed to this
if (!$importers || !isset($importers[$this->modelClass])) {
Also the next line would need to change from
$importer = $importers[$this->modelTab];
to
$importer = $importers[$this->modelClass];
If this looks to be the right path I am happy to make a PR but don't fully understand all of the use cases that I need to account for here.
Additional Context
No response
Validations
silverstripe/installer
(with any code examples you've provided)PRs
The text was updated successfully, but these errors were encountered: