Giter Club home page Giter Club logo

Comments (8)

MrClever avatar MrClever commented on June 12, 2024

I think I understand what you're describing, but a screen shot would be really helpful; are you able to attach an example of the unwanted behaviour to this case?

from crm.

djoh2 avatar djoh2 commented on June 12, 2024

Screenshot 2023-05-01 104653
Screen shot attached -- This replicates across family and person views. I have updated to latest version and it persists. You can see i added an X to a surname to show replication.
Thanks!

from crm.

djoh2 avatar djoh2 commented on June 12, 2024

Hi. I have done some digging here: Both my dev and live sites and databases are up to date. My dev site works fine, my live site returns some person records twice. When I connected the dev site to the live database the person records are also returned twice... I have checked the database records and there is only one record in person_per. This seems specific to me, but can you advise on a fix -- maybe how to have fresh installation without losing data, or where in database error might be?

from crm.

MrClever avatar MrClever commented on June 12, 2024

I've found sometimes, when working with different version of ChurchCRM or different installations, flushing the browser cache can resolve a lot of "weirdness". If you're using any network-side caching for your site (Cloudflare etc) I suggest purging that too after flushing your browser cache. Also double-check your database permissions of both sites - I've seen some hosting providers implement services in odd ways that don't play nice with ChurchCRM.

from crm.

hafizaqibshafique avatar hafizaqibshafique commented on June 12, 2024

I have resolved the issue with the getPeopleSorted() function. The issue was that the function was merging three different arrays ($familyMembersParents, $familyMembersChildren, and $familyMembersOther) into a single array using array_merge(). However, if any of these arrays contained duplicate entries, they would be preserved in the merged array, resulting in duplicate entries being displayed in the table.

To prevent duplicate entries, I have modified the getPeopleSorted() function to remove any duplicates before returning the sorted array. Here is the updated version of the function, which uses the array_unique() function to remove duplicates:

`public function getPeopleSorted() {
$familyMembersParents = array_merge($this->getHeadPeople(), $this->getSpousePeople());
$familyMembersChildren = $this->getChildPeople();
$familyMembersOther = $this->getOtherPeople();

$allFamilyMembers = array_merge($familyMembersParents, $familyMembersChildren, $familyMembersOther);
$uniqueFamilyMembers = array_unique($allFamilyMembers);

return $uniqueFamilyMembers;

}`

Filelocation: ChurchCRM/model/ChurchCRM/Family.php
Family

from crm.

DawoudIO avatar DawoudIO commented on June 12, 2024

Good find, can you create a pull request and I'll test and release in the next release

from crm.

hafizaqibshafique avatar hafizaqibshafique commented on June 12, 2024

Good find, can you create a pull request and I'll test and release in the next release

Sure

from crm.

DawoudIO avatar DawoudIO commented on June 12, 2024

Ya this code had a bug that is fixed in 5.0.0

from crm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.