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

Fixes #8837 Importer issue when running from CLI. #9088

Merged
merged 1 commit into from
Feb 17, 2021

Conversation

inietov
Copy link
Collaborator

@inietov inietov commented Feb 3, 2021

Description

If the importer is launched from the CLI, no user was passed to the CheckoutableCheckedOut.php event.

In the Models/Asset.php@checkout() function I saw an unused variable called $admin that I thought I can use for this because ObjectImportCommand.php already set an user_id that I pass to that unused variable. Then I search for that user and pass it to the event, so it doesn't crash.

See the changes for more info.

Fixes #8837

  • Bug fix (non-breaking change which fixes an issue)

Test Configuration:

  • PHP version: 7.4.14
  • MySQL version: mariadb Ver 15.1 Distrib 10.4.17-MariaDB
  • Webserver version: nginx/1.18.0
  • OS version: Fedora 33

Checklist:

Copy link
Collaborator

@uberbrady uberbrady left a comment

Choose a reason for hiding this comment

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

This looks great! We'll probably want to do a few test passes to make sure - but I think this approach makes great sense. Excellent!

@inietov
Copy link
Collaborator Author

inietov commented Feb 17, 2021

I test it with the sample CSV in the docs, and also modified it a little. But I agree that some users CSVs can be different...

@snipe snipe merged commit 2e2d087 into snipe:develop Feb 17, 2021
snipe added a commit that referenced this pull request Feb 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants