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

Empty import modal - Users/Groups import #1672

Closed
2 tasks done
HeyImPhil opened this issue Feb 3, 2024 · 5 comments
Closed
2 tasks done

Empty import modal - Users/Groups import #1672

HeyImPhil opened this issue Feb 3, 2024 · 5 comments

Comments

@HeyImPhil
Copy link

HeyImPhil commented Feb 3, 2024

Module version(s) affected

2.1.14

Description

When opening the import users or groups from the security admin shows an empty modal.

image

How to reproduce

  1. Fresh install using silverstripe/installer
  2. Go to the security page in the admin
  3. Click Import CSV from the Users or Groups tab
  4. 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)

PRs

@michalkleiner
Copy link
Contributor

Hi @HeyImPhil. I believe this issue has been fixed in 2.1.15, please give it a go. If that's the case, feel free to close the issue.

@HeyImPhil
Copy link
Author

HeyImPhil commented Feb 4, 2024

Hiya @michalkleiner, still same behavior after upgrading to 2.1.15 on my fresh silverstripe/installer site

image

@michalkleiner
Copy link
Contributor

And you ran ?flush in the admin area after the upgrade?

@GuySartorelli
Copy link
Member

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

@emteknetnz
Copy link
Member

emteknetnz commented Feb 8, 2024

Linked PR has been merged, it will auto-tag on 1.13 shortly and will auto-tag on 2.1 in the next week or so, let me know if you need this sooner

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

No branches or pull requests

4 participants