monica icon indicating copy to clipboard operation
monica copied to clipboard

Settings page throws exception after deleting the "self" Contact

Open zaccrites opened this issue 3 years ago • 8 comments

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 avatar Feb 09 '22 19:02 zaccrites

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

UPDATE users SET me_contact_id = null;

zaccrites avatar Feb 09 '22 20:02 zaccrites

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.

codemonkeysoftware avatar Feb 21 '22 17:02 codemonkeysoftware

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!

Arpit-Gulgulia avatar Oct 11 '22 16:10 Arpit-Gulgulia

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"

2lssfsd77 avatar Jan 04 '23 15:01 2lssfsd77

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

mritzmann avatar Aug 12 '23 07:08 mritzmann

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.

rakuna avatar Sep 15 '23 22:09 rakuna

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

iam-subho avatar Oct 06 '23 14:10 iam-subho