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

Cast to ObjectId fails for _id: "undefined" at both User and Organization model #1565

Closed
varshith257 opened this issue Feb 9, 2024 · 5 comments
Labels

Comments

@varshith257
Copy link
Member

Describe the bug

An error is occurring while loading Organization , people and settings screen . The Cast to ObjectId failed for value _id at Organization model and User model.

To Reproduce
Steps to reproduce the behavior:

  1. Login as Admin
  2. Go to People screen and switch between users
  3. or else go to settings you can see the error

Expected behavior

The update organization screen should be rendered without any error. Similarly, the people screen should also be rendered without any error and Organizations should be loaded correctly without any error.

Actual behavior
A clear and concise description of how the code performed w.r.t expectations.

Screenshots
WhatsApp Image 2024-02-10 at 01 48 17_97cb17ab

WhatsApp Image 2024-02-10 at 01 47 43_40663eaf
Additional details
Add any other context or screenshots about the feature request here.

Potential internship candidates
Please read this if you are planning to apply for a Palisadoes Foundation internship PalisadoesFoundation/talawa#359

@varshith257 varshith257 added the bug Something isn't working label Feb 9, 2024
@varshith257 varshith257 changed the title Cast to ObjectId failed for _id: "undefined" at joinedOrganisations for User model Cast to ObjectId failed for _id: "undefined" at both User and Organization model Feb 9, 2024
@varshith257 varshith257 changed the title Cast to ObjectId failed for _id: "undefined" at both User and Organization model Cast to ObjectId fails for _id: "undefined" at both User and Organization model Feb 9, 2024
@Cioppolo14
Copy link

@varshith257 Are you using the latest code from the develop branch?

@varshith257
Copy link
Member Author

varshith257 commented Feb 10, 2024

yes I am using the latest code from both admin and API develop branches

@Cioppolo14
Copy link

I am not seeing this error when I try to replicate it.

@varshith257
Copy link
Member Author

varshith257 commented Feb 10, 2024

Yesterday, I pulled both develop branches into my local machine while trying to work on issue #1451 I suspect that the problem arises when the admin is not assigned to any organization, and the null values are not being cast into array objects. To replicate this issue, you can create a new admin account and not assign them to any organization.

@Cioppolo14
Copy link

@varshith257 I appreciate your investigation, I logged in as an admin without an organization, and did not see this error. I believe that if this is an issue, it will be resolved by some upcoming changes, as every admin should have an assigned organization based on the intent of this application. I am going to close this as unplanned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants