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

Settings page throws exception after deleting the "self" Contact #5981

Open
zaccrites opened this issue Feb 9, 2022 · 8 comments
Open

Settings page throws exception after deleting the "self" Contact #5981

zaccrites opened this issue Feb 9, 2022 · 8 comments
Labels

Comments

@zaccrites
Copy link

Steps to reproduce:

  • Create a contact
  • Go to the Settings page and assign that contact as Self
  • Go back to that contact's page and Delete the contact
  • Go back to the Settings page

Attempt to read property "id" on null (View: /var/www/html/resources/views/settings/index.blade.php)

Using self-hosted Docker tag 3.6.1

image

@zaccrites
Copy link
Author

@zaccrites
Copy link
Author

I was able to undo this by setting the me_contact_id field back to null.

UPDATE users SET me_contact_id = null;

@asbiin asbiin added the bug label Feb 20, 2022
@codemonkeysoftware
Copy link

There is a foreign key constraint to handle this, but it does not get triggered due to using soft deletes. I'm not sure what the idiomatic Laravel way to fix this would be, though.

@Arpit-Gulgulia
Copy link

I am able to reproduce the error with the steps mentioned above.
image

@asbiin, can we add an enhancement that will ask the user to first delink the contact from assigned as self, and then it will allow the user to delete the contact only if that contact is not marked as me. If this sounds good, I can work and create a PR on it. Thanks!

@2lssfsd77
Copy link

I'm experiencing the same issue after deleting contact assigned as self

"Attempt to read property "id" on null (View: /srv/app/monicahq/htdocs/resources/views/settings/index.blade.php)

Error number : 9a8646568d14440a84174369d85c2d58"

ccrims0n added a commit to ccrims0n/monica that referenced this issue Jan 23, 2023
* Add deleted observer on the contact model
@mritzmann
Copy link

mritzmann commented Aug 12, 2023

Is there any way to fix that without database access? I have an account on https://app.monicahq.com and currently there is no way to cancel my subscription because settings is broken. Email support is not responding (requested on August 7).

Edit: solved via support

@rakuna
Copy link

rakuna commented Sep 15, 2023

Is there any way to fix that without database access? I have an account on https://app.monicahq.com and currently there is no way to cancel my subscription because settings is broken. Email support is not responding (requested on August 7).

I’m having the same issue, looking to cancel subscription but cannot do to this error.

@iam-subho
Copy link

@asbiin can i work on this issue or it is already solved??

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

8 participants