Skip to content

Commit

Permalink
Fix a bug in Latest/Updated Date of Family and Person record (#7116)
Browse files Browse the repository at this point in the history
# Description & Issue number it closes 
#7115

## How to test the changes?
Check dashboard Latest Family, Updated Family, Latest Persons, Updated
Persons after adding/updating Family/Person

## Type of change

- [X] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] This change requires a documentation update

# How Has This Been Tested?
I have tested it in docker.

# Checklist:

- [X] My code follows the style guidelines of this project
- [X] I have performed a self-review of my code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [X] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream
modules
  • Loading branch information
DAcodedBEAT authored Aug 21, 2024
2 parents 7797a8f + 0380c2f commit c0d029f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
9 changes: 7 additions & 2 deletions src/FamilyEditor.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,13 @@
$family = new \ChurchCRM\model\ChurchCRM\Family();
if ($iFamilyID >= 1) {
$family = FamilyQuery::create()->findPk($iFamilyID);
$family
->setDateLastEdited(date('YmdHis'))
->setEditedBy(AuthenticationManager::getCurrentUser()->getId());
} else {
$family
->setDateEntered(date('YmdHis'))
->setEnteredBy(AuthenticationManager::getCurrentUser()->getId());
}
$family
->setName($sName)
Expand All @@ -252,8 +259,6 @@
->setHomePhone($sHomePhone)
->setWorkPhone($sWorkPhone)
->setCellPhone($sCellPhone)
->setDateEntered(date('YmdHis'))
->setEnteredBy(AuthenticationManager::getCurrentUser()->getId())
->setSendNewsletter($bSendNewsLetterString)
->setEnvelope($nEnvelope);
if ($dWeddingDate) {
Expand Down
9 changes: 7 additions & 2 deletions src/PersonEditor.php
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,13 @@
$personAlreadyExist = $iPersonID > 0;
if ($personAlreadyExist) {
$person = PersonQuery::create()->findOneById($iPersonID);
$person
->setDateLastEdited(date('YmdHis'))
->setEditedBy(AuthenticationManager::getCurrentUser()->getId());
} else {
$person
->setDateEntered(date('YmdHis'))
->setEnteredBy(AuthenticationManager::getCurrentUser()->getId());
}

$person
Expand All @@ -410,8 +417,6 @@
->setFamId($iFamily)
->setFmrId($iFamilyRole)
->setClsId($iClassification)
->setDateEntered(date('YmdHis'))
->setEnteredBy(AuthenticationManager::getCurrentUser()->getId())
->setFlags($per_Flags)
->setFacebook($sFacebook)
->setTwitter($sTwitter)
Expand Down

0 comments on commit c0d029f

Please sign in to comment.