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

FIX Use valid class for model importers #1657

Conversation

GuySartorelli
Copy link
Member

Description

BulkLoader is being initialised with the tab name instead of the class name when a custom tab name is provided.
This is related to the wider issue #1364

Issues

Pull request checklist

  • The target branch is correct
  • All commits are relevant to the purpose of the PR (e.g. no debug statements, unrelated refactoring, or arbitrary linting)
    • Small amounts of additional linting are usually okay, but if it makes it hard to concentrate on the relevant changes, ask for the unrelated changes to be reverted, and submitted as a separate PR.
  • The commit messages follow our commit message guidelines
  • The PR follows our contribution guidelines
  • Code changes follow our coding conventions
  • This change is covered with tests (or tests aren't necessary for this change)
  • CI is green

@GuySartorelli GuySartorelli mentioned this pull request Jan 23, 2024
Comment on lines -678 to +681
$this->redirectBack();
return false;
return $this->redirectBack();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

false is not a valid return type for this method in Silverstripe CMS 5.
It causes a behat failure in various scenarios of the "Import in GridField" behat feature:

Uncaught TypeError: SilverStripe\Admin\ModelAdmin::import(): Return value must be of type SilverStripe\Control\HTTPResponse, bool returned

Copy link
Contributor

@michalkleiner michalkleiner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 MOG

@GuySartorelli
Copy link
Member Author

The failing behat test will be resolved separately - it's a pre-existing failure not related to this PR.

@sabina-talipova sabina-talipova merged commit 04e1856 into silverstripe:2.1 Jan 23, 2024
11 of 12 checks passed
@sabina-talipova sabina-talipova deleted the pulls/2.1/model-importer-fix branch January 23, 2024 03:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants