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

_req_user not available when running migrations #4768

Closed
perenstrom opened this issue Aug 14, 2018 · 3 comments
Closed

_req_user not available when running migrations #4768

perenstrom opened this issue Aug 14, 2018 · 3 comments

Comments

@perenstrom
Copy link

Expected behavior

When running save commands on a model during a migration script (as in the example under Creating items on https://keystonejs.com/documentation/database), the revision document for the saved item should contain a user tag.

Actual/Current behavior

It appears that _req_user is not sent to the history pre-save hook, since it's not part of a request? This causes the admin interface to crash when trying to parse the name of the user for the revision, since u doesn't exist in the revision document.

Steps to reproduce the actual/current behavior

Create a keystone model with history enabled. In a migration script, save a document to this model. Try to access the document in the admin interface.

Environment

Software Version
Keystone 4.0.0-beta.8
Node.js 6.14.3
@perenstrom
Copy link
Author

It appears the admin interface crashes because of a forked change in our repository. So the crash is not an issue with current master, but instead of changes in keystonejs/keystone#4398.

@perenstrom
Copy link
Author

A possible solution would be to add a guard around the printing of the user information in that dropdown. (Commenting here to remember it).

@stennie
Copy link
Contributor

stennie commented Aug 16, 2018

@perenstrom Thanks for following up on the source of the issue. Since this is specific to changes on a fork, appropriate fixes should be made there as well. The application update framework is unaware of downstream changes/usage.

Regards,
Stennie

@stennie stennie closed this as completed Aug 16, 2018
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

No branches or pull requests

2 participants