Fix lack of price set options for edit registration from search results #24671
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
A regression was introduced in 5.33 in #19125 that prevents the display of selected price set options when editing a registration from search results (but not from the contact events tab). That PR forced the form to action ADD when the context was search. This didn't seem to be a problem for editing the registration in general (the action was still UPDATE for the main body of the form, but it was ADD for the price set template embedded in it, causing it to not display correctly). Not entirely clear to me why the action was different, but this fixes the problem by not changing the action if it is UPDATE.
Notice that the action at the top of the page is 2 in Participant.tpl, but then when Participant.tpl comes back for another round to show the fee block, the action has changed to 1 (not sure why or how Participant.tpl is called a second time inside itself).
Before
After
Technical Details
Can't say this looks good, but it works and this already stretched my understanding of contexts and actions so I'm not seeing a better solution (other than separating the forms of course).