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

Exception seen when importing from custom URL slug #1680

Closed
2 tasks done
mikenuguid opened this issue Feb 16, 2024 · 5 comments
Closed
2 tasks done

Exception seen when importing from custom URL slug #1680

mikenuguid opened this issue Feb 16, 2024 · 5 comments

Comments

@mikenuguid
Copy link
Contributor

mikenuguid commented Feb 16, 2024

Module version(s) affected

1.13.22

Description

Using import csv on a model admin that has a custom url slug generates an exception: Undefined array key.

How to reproduce

  • create a model admin with custom url slug
private static array $managed_models = [
        'link' => [
            'title' => 'Links',
            'dataClass' => Link::class,
        ],
    ];
  • prepare some csv data to populate the model
  • open the CMS and navigate on the model admin
  • press import csv, press choose file and select the csv file containing data
  • page breaks and exception seen

Possible Solution

This might be caused by this line https://github.com/silverstripe/silverstripe-admin/blob/1.13.22/code/ModelAdmin.php#L734 where it should be using modelTab instead of modelClass.

I haven't created a pull request yet but hopefully this is a quick fix. :)

Additional Context

Screenshot from 2024-02-26 12-36-30

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

@GuySartorelli
Copy link
Member

GuySartorelli commented Feb 28, 2024

I think this is a duplicate of #1686 which was fixed in 1.13.23.
Can you please check if that fixes the problem for you?

If it doesn't, please provide the full error message - and if you'd like to raise a pull request which fixes this and includes a test that would be fantastic.

@mikenuguid
Copy link
Contributor Author

Yeah it's still an issue (identical with the description above). Will create a pull request like you suggested.

@GuySartorelli
Copy link
Member

GuySartorelli commented May 5, 2024

@mikenuguid Have you had a chance to look at raising a pull request for this?
If you don't raise a pull request but also don't provide the full error message (as text please, not an image), I will have to close this issue for lack of information.

@mikenuguid
Copy link
Contributor Author

Thanks for chasing, I'll find time this week.

@GuySartorelli
Copy link
Member

PR merged. This will be automatically tagged by GitHub actions.
Thanks for reporting and fixing this!

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

2 participants