-
-
Notifications
You must be signed in to change notification settings - Fork 825
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
CRM-21643 : Profile confirmation page shows the wrong values for multi-value custom data #11529
Conversation
…i-value custom data
Tested on our system and working fine. |
@lcdservices I know you use this functionality - do you have comment on this? For background I know this has been discussed somewhat before with the issue being that it's often assumed but not intrinsic that the last value in a multi set is the 'most recent' & should be shown in this circumstance. I think the code has been tested & the change is fine / limited to the fact that whenever multivalue records are retrieved the most recent rather than earliest will be grabbed. I'm a soft + 1 on that being more logical but think it would be good to get more comments (@seamuslee001 @systopia @JoeMurray @Stoob @mlutfy @colemanw @guanhuan .....) |
@eileenmcnaughton @monishdeb I ran through tests and it works fine. I think the assumption is ok. When in the context of a profile edit form, we don't return the user to the profile view -- we return them to the main profile edit form which displays a list of the multi-records. So the only context in which this applies for multi-record fields is when you are using the profile create form. When adding a new record I think we can assume the last record id is the one just created. The only potential issue I could think of is if there's a race condition -- e.g. if multiple people are adding multi-records at the same time. That's probably a distant edge case (the second insertion would need to happen between when the first insertion is complete and the record returned, which is a minuscule gap of time). |
What if to show all multi-values rather then the latest one i.e. if custom field support multivalue then use GROUP_CONCAT on its SELECT column of the search query. I think this fix itself doesn't solve the race condition but a close enough solution to show all the value on view page after save also optimise the search query to have less record due to GROUP BY. |
@monishdeb @lcdservices I just looked at this again & I am OK with the change in the screen - but UFGroup::getValues is called from lots of places so this is not very contained - much as I hate to suggest it could we add a $isGetHighestID param to the function & handle that way? |
@monishdeb just revisiting this - I think it would be safe if instead of the code in place we changed this
to
It would need a unit test. I'm going to close this because I think the discussion is useful & should be linked to but on revisiting I think it needs a test before it is review-ready & given it;s age it's probably better closed & re-opened |
Hmm - looks like this duplicates anyway #12337 |
Overview
Steps to replicate:
Expected: The custom field should show the last data entered i.e. 'second data'
Before
After