-
-
Notifications
You must be signed in to change notification settings - Fork 825
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
CRM-17267 Fix change event selections impossible for sold out options #10804
Conversation
Just need to double check this use of is_full: |
Yes, this is ready for QA |
Jenkins, would you be so kind as to retest this please? |
@JKingsnorth I tried to replicate this & failed - the screenshot is without - you can see I have the option of deselecting I DID hit #11934 |
Clarified the steps to recreate on JIRA. Try it with a 'checkboxes' and a 'required' field. |
Ok I can see it now BEFORE What bothers me about this is that I feel like we need to mark this pretty clearly in the UI if we are going to make this change. Perhaps a confirm popup on submit (although my recollection is we don't have a good easy way to do this) if sold out is exceeded or js to add some red text beside the option that will exceed saying 'if you submit this the event will be oversubscribed' ping @agh1 @Stoob @jusfreeman @colemanw if anyone has thoughts |
Hmn I thought I'd configured this to only 'unfreeze' the sold out option if it was 'ticked' - ie: to allow people to deselect it, but not select it for new people. Apparently that's not what's happening. But I think that would be a good solution that would prevent the event becoming oversubscribed? Edit: It's been a while since I looked at this, so I'd need to get my head back into it again. |
@JKingsnorth that makes sense to have the option only be available if it's already selected. If that's not feasible, or if you prefer, one idea might be to have a checkbox called "Show sold-out options". That might act a little like the glass you need to break before pulling the fire alarm. |
$overrideIsFull = FALSE; | ||
if ($className == 'CRM_Event_Form_Participant' || $className == 'CRM_Event_Form_ParticipantFeeSelection') { | ||
$overrideIsFull = 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.
@JKingsnorth lets change it 1 line:
$overrideIsFull = (in_array($className, ['CRM_Event_Form_Participant', 'CRM_Event_Form_ParticipantFeeSelection']));
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.
@monishdeb you mean change that one line in this PR?
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.
oh I see - quicker way to say it
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.
Yes, but this is no longer required if we move this check below at L739 :)
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.
@monishdeb I think if ($form->isBackOffice) would work :-)
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.
Umm nope as CRM_Event_Form_ParticipantFeeSelection
doesn't inherit that property. Unless we should add that property to CRM_Core_Form
and let the child form decide wether they like to be in front or as a silent worker
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.
We can just add it to CRM_Event_Form_ParticipantFeeSelection I guess - if it IS always backoffice?
@@ -729,16 +735,12 @@ public static function formatFieldsForOptionFull(&$form) { | |||
$isFull = TRUE; | |||
} | |||
} | |||
$option['is_full'] = $isFull; | |||
// 'is_full' says whether we should freeze the option in \CRM_Price_BAO_PriceField::freezeIfEnabled | |||
$option['is_full'] = $overrideIsFull ? FALSE : $isFull; |
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.
Oh we can further reduce it too:
$option['is_full'] = (in_array($className, ['CRM_Event_Form_Participant', 'CRM_Event_Form_ParticipantFeeSelection'])) ? FALSE : $isFull;
@monishdeb so the issue here is that it unlocks the full options when not selected too I think - but if we could resolve a new PR & get it merged.... |
@monishdeb I'm inclined to close this in favour of a much simpler PR
What do you think? |
@eileenmcnaughton that patch makes sense to me. Can you create a new PR with before/after screenshot. Will then close it in favor of that PR. |
I'm happy to review and test the new PR, link it from here when it's up and I'll take a look. |
@JKingsnorth @monishdeb done #13096 I'll close this in favour of that |
See https://issues.civicrm.org/jira/browse/CRM-17267