[user_accounts] Prevent crash when one user has no site/project affiliations #8139
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Brief summary of changes
Although this usecase should never happen as it is prevented by rules in the edit_user logic, a couple bugs have let it happen in the pass and the entire module becomes inaccessible. This makes the module load and displays a message in the user row informing the editor that the user does not currently have any sites and projects.
The only way to test this would be to manually delete all site associations directly in the DB
user_psc_relOR all project associationsuser_project_relNote that the module crashes even if the user not having any sites or projects is not the editor nor the editee... any user can cause this issue