-
-
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
dev/core#1936 Make the price field value label field not required #18123
dev/core#1936 Make the price field value label field not required #18123
Conversation
(Standard links)
|
b5c3270
to
eaa9cb0
Compare
@@ -29,6 +29,8 @@ class PriceFieldValueCreationSpecProvider implements Generic\SpecProviderInterfa | |||
public function modifySpec(RequestSpec $spec) { | |||
// Name will be auto-generated from label if not supplied | |||
$spec->getFieldByName('name')->setRequired(FALSE); | |||
// Ensure that label is required this matches v3 API but doesn't match DAO because form fields allow for NULLs | |||
$spec->getFieldByName('label')->setRequired(TRUE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@seamuslee001 so I'm inclined to go with it not being required in either api - I think the reason it was required was nasty munging behaviour. If that's hard to deal with I'm OK with apiv4 not matching v3 - as long as v4 is 'right'
(am also OK punting that for master)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no idea but it seems it has been required in the API since v4.5 e825f02 so it would feel very strange to break that but maybe its ok for v4. Also the JIRA mentioned in that commit looks wrong https://issues.civicrm.org/jira/browse/CRM-14788. I would say keep label required for the moment and can manage in master
eaa9cb0
to
99d123a
Compare
Looks good to me - I'll see what jenkins & @KarinG have to say |
Hi - my d8civicrm.local is a 5.27.4 at the moment so figured I would try this:
karins-MBP:civicrm-core sysadmin$ cat 18123.diff |patch -p1
Checking the db -> I still see "null" Ok trying this manually: Manually phpMyAdmin will let me change 'null' to NULL Ok manually changed -> I get (same contribution pages I reproduced the issue on) Back to Configure -> my empty labels have NULL now - removing them. Saving -> DB Constraint violation - ( ! )
So what did we do before -> on a 5.27.3 site - I can't do [simple/clean no labels] |
Fix test and ensure default value is NULL
99d123a
to
7154c2c
Compare
adding merge on pass based on @KarinG testing on another PR and this being an identical copy except for the upgrade step |
Overview
This reverses a change made in 5.27 which makes the price field value, label field non required preventing string 'null' from being saved
Before
Field is required
After
Field is not always required
Technical Details
I made sure apiv4 matched apiv3 in that the label is required if your using the API
ping @eileenmcnaughton @KarinG @demeritcowboy