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 RegistryAdmin add missing return to import #114

Merged

Conversation

CCCMichaelCole
Copy link
Contributor

@CCCMichaelCole CCCMichaelCole commented Dec 2, 2024

Description

When importing a CSV file into a registry it will complete the import but fails to return (redirect) back to the registry popup dialog with a "good" (successful) message. The user's gets a broken screen (css not loading).

Debugging error logs
[Emergency] Uncaught TypeError: SilverStripe\Registry\RegistryAdmin::import(): Return value must be of type SilverStripe\Control\HTTPResponse, none returned

There is a missing RETURN in file RegistryAdmin > import function > line 126.

$this->redirectBack();

I've added the return and tested that it works.

Manual testing steps

  1. Go to an existing Registry and export a CSV file
  2. Ensure the file meets the required import form fields requirements
  3. Import the CSV file and it will produce an error

Issues

#113

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)
  • Any relevant User Help/Developer documentation is updated; for impactful changes, information is added to the changelog for the intended release
  • CI is green

@GuySartorelli
Copy link
Member

GuySartorelli commented Dec 2, 2024

Thanks for submitting this.

Can you please retarget this PR to 3.2 so that it can be released as a patch? Otherwise it would need to wait until the next minor release in April. You may need to reset your commits after retargetting the PR.

Please also add FIX to the beginning of the commit message (and don't include a colon, like the PR name does)

@CCCMichaelCole CCCMichaelCole changed the base branch from 3 to 3.2 December 4, 2024 23:58
@CCCMichaelCole CCCMichaelCole changed the title FIX: RegistryAdmin add missing return to import FIX RegistryAdmin add missing return to import Dec 4, 2024
@CCCMichaelCole
Copy link
Contributor Author

CCCMichaelCole commented Dec 5, 2024

@GuySartorelli before I do Solution 2 in "reset commits" I'm still showing other commits in the PR after doing solution 1, can you advise what I have done wrong.

@GuySartorelli
Copy link
Member

I don't know what you've done wrong, sorry. That's the steps I take when I need to do this. Some people have success with it and others like yourself don't. Without sitting with you and watching you do it I couldn't say what went wrong 😅

Add missing return to import function line 126, causing HttpResponse error is none.
@CCCMichaelCole
Copy link
Contributor Author

@GuySartorelli I've done the corrections.

Copy link
Member

@GuySartorelli GuySartorelli left a comment

Choose a reason for hiding this comment

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

Fantastic, thank you. I'll merge it when CI has gone green

@GuySartorelli GuySartorelli merged commit 186b1fa into silverstripe:3.2 Dec 5, 2024
9 checks passed
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.

2 participants