ChurchCRM / CRM

ChurchCRM is an OpenSource Church CRM & Management Software.
https://ChurchCRM.io
MIT License
616 stars 434 forks source link

Bug: Editing Family erroneously updates country information #6657

Open DAcodedBEAT opened 10 months ago

DAcodedBEAT commented 10 months ago

Description A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Install ChurchCRM
  2. Add new user, and create family from user
  3. Go to Active Family List
  4. Edit Family
  5. Go to Active Family List
  6. See how country has been replaced with country code

Expected behavior A clear and concise description of what you expected to happen.

Always use the Country instead of the Country code.

Screenshots If applicable, add screenshots to help explain your problem.

image
github-actions[bot] commented 8 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 7 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 6 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

grayeul commented 5 months ago

Is this still a problem? I was trying to re-create... and when you add a new person, you don't have the option to provide address info, at that time. But when you create the family, the Country (seems to default to first one, Afghanistan - rather than NULL) is populated. The only place I see the Country Code being used is in the Address list in the Active Family List. Are you just talking about where it is displayed there?

And if so, do we really want the full country name in that view, where there is not a lot of width to display a full address? The Code also shows up when viewing an individual family, in the right-hand 'Address' section.

respencer commented 4 months ago

I've just seen something similar on the Active Family List for me, but in my case it put in the Provinces abbreviation when I manually added an address.

Screenshot 2024-04-22 at 10-51-40 ChurchCRM Active Family List

respencer commented 4 months ago

Looking through the DB I see that sometimes the state has its full name, sometimes an abbreviation, and sometimes NULL -- despite a default being set. Same for country.

respencer commented 4 months ago

Tried again, still can't reproduce original issue.

respencer commented 4 months ago

Interestingly I've found a new bug where the Country for a family can't be changed from the default Country.

respencer commented 4 months ago

And now I can't reproduce it again, weird.

respencer commented 4 months ago

But now I see that something has change the phone number of one of our international members.

The number is missing the + at the front and the last digit at the end.

respencer commented 4 months ago

Well whatever the issue is it appears to have changed. Now ChurchCRM consistently crashes with a 500 for me if I try to change the address from the default.

webserver-1   | 172.16.0.33 - - [03/May/2024:17:05:31 +0000] "POST /FamilyEditor.php?FamilyID=46 HTTP/1.1" 500 210 "http://localhost/FamilyEditor.php?FamilyID=46" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36"
respencer commented 3 months ago

Still trying to figure this out, but I still can't recreate it exactly as described.

In my latest attempt I consistently crashed due to a missing date string:

PHP Fatal error:  Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'nte_DateEntered' cannot be null in /var/www/html/vendor/propel/propel/src/Propel/Runtime/Connection/StatementWrapper.php:204
Stack trace:
#0 /var/www/html/vendor/propel/propel/src/Propel/Runtime/Connection/StatementWrapper.php(204): PDOStatement->execute()
#1 /var/www/html/ChurchCRM/model/ChurchCRM/Base/Note.php(1131): Propel\Runtime\Connection\StatementWrapper->execute()
#2 /var/www/html/ChurchCRM/model/ChurchCRM/Base/Note.php(1024): ChurchCRM\model\ChurchCRM\Base\Note->doInsert()
#3 /var/www/html/ChurchCRM/model/ChurchCRM/Base/Note.php(969): ChurchCRM\model\ChurchCRM\Base\Note->doSave()
#4 [internal function]: ChurchCRM\model\ChurchCRM\Base\Note->ChurchCRM\model\ChurchCRM\Base\{closure}()
#5 /var/www/html/vendor/propel/propel/src/Propel/Runtime/Connection/TransactionTrait.php(35): call_user_func()
#6 /var/www/html/ChurchCRM/model/ChurchCRM/Base/Note.php(960): Propel\Runtime\Connection\ConnectionWrapper->transaction()
#7 /var/www/html/ChurchCRM/model/ChurchCRM/Family.php(232): ChurchCRM\model\ChurchCRM\Base\Note->save()
#8 /var/www/html/FamilyEditor.php(420): ChurchCRM\model\ChurchCRM\Family->createTimeLineNote()
#9 {main}

Once I fixed that, I noticed that the time line didn't know who was doing the editing:

Screenshot_20240603_214122

And the address is wrong (NIM is Niger).

Going back to edit it automatically changed too:

Screenshot_20240603_214320

The address I was using to start off with:

Screen Shot 2024-06-03 at 21 45 41

Checking the database, there are multiple failures:

Screenshot_20240603_223902

github-actions[bot] commented 4 weeks ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.