-
Notifications
You must be signed in to change notification settings - Fork 501
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
nullpointer fix when getting notification with newly created user #8969
Conversation
After some testing: when a user is created with shibboleth in UI, that user is directly set in the session. It gives nullpointer until you log out and log in again (user is loaded from database). This pull request should fix that. |
I moved this to review because just now @donsizemore logged into Harvard Dataverse with a new Shib account and got a 500 error when he clicked My Data. As far as we understand, the workaround (until this PR is merged) is to log out and back in. That way the "muted emails" code checks the database and is initialized. |
This workaround is valid. Technically, it is a little bit different: with log-out and log-in again nothing is written in DB, but the object is initialized differently (muted e-mails are empty i.s.o. being null). This pull request fixes the initialization of the object when it is constructed by creating a new account (it was the case I had missed when making the initial pull request). Until you mute something, nothing is written in DB. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another proposed fix just came in:
@ErykKul since you wrote the original code, I'm inclined to go with your fix. 😄 Any thoughts on the other proposal? (If you want you could leave a review on it.)
Phil points out that testing of this will not be straightforward based on our current environment. To do this the right way - will require a full Shiboleth setup. This calls out that we do not have a current shiboleth environment. For this we'll do this with the artificial dev mode for this PR. |
What this PR does / why we need it:
This fixes the nullpointer on DataverseUserPage when creating a new user.