Skip to content
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#1588 Fix regression where empty string is passed to PropertyBag #16532

Merged
merged 1 commit into from
Feb 14, 2020

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Feb 14, 2020

Overview

Fixes a regression where a fatal error results when:

If you enabled the recurring option "Support recurring intervals" on a contribution page you can no longer submit the contribution form unless you enter a value for the recurring interval, even if you have not selected to make a recurring contribution.

Before

Fatal
Error: recurFrequencyInterval must be a positive integer

After

No error

Technical Details

We have a scenario where the checkbox is presented but is optional. This is then in 'params' which is passed through to
PropertyBag. The value is equal to '' so it fails to validate when we use it to set the value on the PropertyBag.

I don't think we lose anything meaningful by not setting an empty string and it avoids this error so we should
merge & release as a regression fix IMHO. If we want to revist then we should do that in master

https://lab.civicrm.org/dev/core/issues/1588

Comments

@artfulrobot @mattwire

We have a scenario where the checkbox is presented but is optional. This is then in 'params' which is passed through to
PropertyBag. The value is equal to '' so it fails to validate when we use it to set the value on the PropertyBag.

I don't think we lose anything meaningful by not setting an empty string and it avoids this error so we should
merge & release as a regression fix IMHO. If we want to revist then we should do that in master

https://lab.civicrm.org/dev/core/issues/1588
@civibot
Copy link

civibot bot commented Feb 14, 2020

(Standard links)

@civibot civibot bot added the master label Feb 14, 2020
@eileenmcnaughton eileenmcnaughton changed the base branch from master to 5.23 February 14, 2020 01:50
@civibot civibot bot added 5.23 and removed master labels Feb 14, 2020
@eileenmcnaughton eileenmcnaughton changed the title dev/core#1588 Fix regression where empty string is passed to SettingsBag dev/core#1588 Fix regression where empty string is passed to PropertyBag Feb 14, 2020
@artfulrobot
Copy link
Contributor

I would prefer this: #16538

@artfulrobot
Copy link
Contributor

Is there ever a case when a property wants to get set to ZLS?

@eileenmcnaughton
Copy link
Contributor Author

is ZLS an acronym? I see Zimmermann–Laband syndrome

Zero Length String?

@eileenmcnaughton
Copy link
Contributor Author

I would be very surprised - given where we are coming from - if the difference between NULL & '' is material for receiving functions

@seamuslee001
Copy link
Contributor

merging as the discussion suggests that this is an ok way to go forward

@seamuslee001 seamuslee001 merged commit 9ac50fd into civicrm:5.23 Feb 14, 2020
@artfulrobot
Copy link
Contributor

artfulrobot commented Feb 17, 2020

late reply, but yes, I meant "" for zero length string (ZLS). My bad for the TLA, IDK! LOL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants