The Wayback Machine - https://web.archive.org/web/20201203234614/https://github.com/monicahq/monica/issues/1927
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

"Date you met" defaults to today upon edit, even if "I don't know" was selected previously #1927

Open
GjjvdBurg opened this issue Oct 19, 2018 · 1 comment

Comments

@GjjvdBurg
Copy link

@GjjvdBurg GjjvdBurg commented Oct 19, 2018

Thanks for a great project!

Describe the bug

  1. For a contact, click "add" under the "How You Met" section
  2. Add description, and select "I don't know the date we met", click Save.
  3. Now click "edit" under the "How You Met" section. The radio button under "Date you met" is on today's date again.

This is confusing, since I shouldn't have to reset the radio button to a previously selected choice on editing.

Which version are you using:

  • A server I maintain myself, version 2.9.0
@mechanarchy
Copy link
Contributor

@mechanarchy mechanarchy commented Feb 25, 2019

This is still present in 2.12.0. I've had a look through the code for this and it seems there's a couple of reasons:

  • resources/views/people/introductions/edit.blade.php expects a property $contact->first_met that no longer appears to exist. I've done a workaround for this but it didn't fix the problem described above.

    {{ (is_null($contact->first_met)) ? 'checked' : '' }}

  • Even when the generated HTML is correct (ie, checked attribute set as intended), as soon as the JavaScript code runs it overrides the value. I believe this is because resources/assets/js/app.js:341 sets date_met_the_contact: 'known' at a global level. I don't know enough about Vue yet to resolve this.

    date_met_the_contact: 'known',

It looks like most of the global-level properties are used by .blade.php style files and the .vue files have local state - so perhaps rewriting this page into the .vue style entirely will fix it and will make it more consistent with the majority of the codebase.

(Updated 2019-11-26 to add code snippets)

@asbiin asbiin removed the Hacktoberfest label Nov 14, 2019
simonardejr added a commit to simonardejr/monica that referenced this issue Oct 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants
You can’t perform that action at this time.