-
-
Notifications
You must be signed in to change notification settings - Fork 824
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
[REF] Fix regression where adding any date based field onto a profile… #17973
[REF] Fix regression where adding any date based field onto a profile… #17973
Conversation
(Standard links)
|
@seamuslee001 I feel like the original sin here is we are trying to use one field to hold 2 different types of values What about this
|
hmm you would also have to update the selectValues line and what about using formatType given that is what is in the xml? |
So the previous method was to 'dress' the xml date data like this
|
It wouldn't hit the selectValues in the other case I don't think |
it seems the profile output is doing that but not for where ever you had to add the attribute right? So my thinking is whatever array key we need to use then that has to be the array key passed to selectValues |
@seamuslee001 so we have 2 scenarios
We should handle these by populating different keys before they hit The current round of regressions came about because we were not handling minDate & maxDate in searches |
Sure but my point is that should we not for the first one pass in an array key of formatType rather than format given that is what key we have used in the xml to store those sorts of strings. My other point is that in your example code
Needs to change to be what ever attribute key we end up passing in |
@seamuslee001 so the patch winds up looking something like
because you need to back out the change in addForm & narrow the min max part down to kick in where it's needed |
any reason why you want date_preference rather than format_type? |
DatePreference is an entity |
I guess it just feels better to me to use format_type because that is what the metadata will use but 6/1 (1/2)/12 |
Yeah - formatType is OK too |
… triggers an error date preferences not configured when previewing the profile
d1ef269
to
db91a58
Compare
updated now @eileenmcnaughton |
The fatal has gone for me with this change. |
Fails all look familiar / unrelated |
… triggers an error date preferences not configured when previewing the profile
Overview
This fixes recent regression where adding any date field onto a profile causes a fatal error when previewing that profile
Reproduction steps
Before
Fatal Error
After
No Fatal error
Technical Details
This is happening because the dateMetadata has already been added here https://github.com/civicrm/civicrm-core/blob/master/CRM/Core/BAO/UFGroup.php#L510 which includes setting the min year and max year appropriately
ping @demeritcowboy @eileenmcnaughton