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

CiviEvent - Fix missing default values for required fields in event registration setup #25410

Conversation

larssandergreen
Copy link
Contributor

@larssandergreen larssandergreen commented Jan 24, 2023

Overview

#24863 caused a regression so that the default values were no longer set for the required fields on the Online Registration tab when configuring an event (as noted on Stack Exchange). The cause was that the default values were being set to null from API4 whereas previously the array keys did not exist.

I replaced all uses of Civi_Util_Array:value with ?? in this function. I also made the Registration Link Text required, which seems to be the original intent (if you don't enter a value, the default is used anyways). If this wasn't changed, there would be odd behaviour if the field was set to nothing, resulting in it being re-filled with the default.

Before

No default values, which is annoying because you are still forced to enter a title for the confirmation screen even if it is disabled.

After

Default values loaded as before.

@civibot
Copy link

civibot bot commented Jan 24, 2023

(Standard links)

@civibot civibot bot added the master label Jan 24, 2023
@larssandergreen larssandergreen force-pushed the Fix-missing-default-values-for-required-fields-in-event-registration-setup branch from be1bdee to bccb826 Compare January 24, 2023 06:56
@demeritcowboy
Copy link
Contributor

Thanks @larssandergreen can you put against 5.58?

@larssandergreen larssandergreen force-pushed the Fix-missing-default-values-for-required-fields-in-event-registration-setup branch from bccb826 to 2fa95a7 Compare January 24, 2023 18:39
@larssandergreen larssandergreen changed the base branch from master to 5.58 January 24, 2023 18:41
@civibot civibot bot added 5.58 and removed master labels Jan 24, 2023
@demeritcowboy
Copy link
Contributor

Fun with git. You'll need to do something like

git fetch upstream 5.58
git rebase upstream/5.58

where upstream is the real civi repo.

@larssandergreen larssandergreen force-pushed the Fix-missing-default-values-for-required-fields-in-event-registration-setup branch from 7a0d81b to 63b7f89 Compare January 24, 2023 19:05
@seamuslee001
Copy link
Contributor

Jenkins re test this please

@eileenmcnaughton
Copy link
Contributor

test this please

@totten totten changed the title Fix missing default values for required fields in event registration setup CiviEvent - Fix missing default values for required fields in event registration setup Jan 26, 2023
@totten
Copy link
Member

totten commented Jan 26, 2023

I did some r-run and confirmed the defaults worked better.

There were test failures in CRM_Event_Form_ManageEvent_RegistrationTest. Pushed up a commit which should address that.

@larssandergreen
Copy link
Contributor Author

I didn't see the test failures, but looking at CRM_Event_Form_ManageEvent_RegistrationTest I suspect I just need to add the newly required field to the test data, which I've just done.

@totten
Copy link
Member

totten commented Jan 26, 2023

Thanks @larssandergreen. Applied the same to the backport.

@totten
Copy link
Member

totten commented Jan 26, 2023

Test failures are unrelated.

@totten totten merged commit 3b437e8 into civicrm:5.58 Jan 26, 2023
@larssandergreen larssandergreen deleted the Fix-missing-default-values-for-required-fields-in-event-registration-setup branch May 24, 2023 05:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants