-
Notifications
You must be signed in to change notification settings - Fork 48
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
PCHR-3654: Make it Impossible to Uncheck Work pattern As Default #2604
Conversation
$isToBeUncheckedAsDefault = isset($params['is_default']) && !$params['is_default']; | ||
if($isToBeUncheckedAsDefault && $isDefaultWorkPattern) { | ||
throw new CRM_HRLeaveAndAbsences_Exception_InvalidWorkPatternException( | ||
'It is not possible to have no default Work Pattern' |
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.
Does this also implies Default Work Pattern required.
? Guess it will be more simplified if it means same thing.
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 a default Work pattern is required. A default work pattern is actually shipped with the default CiviHR installation
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.
Looks good
…ic methods. Add tests.
…efault PCHR-3660: Make it impossible to set a disabled Work pattern as default.
Overview
Currently, It is possible to unselect a work pattern as default, leaving a CiviHR site without a default work pattern which breaks many things. This PR fixes the issue and makes sure that the default work pattern can not be unselected to make it non default, rather default work pattern change should happen from edit/create screen of a new work pattern (This is the current behaviour).
Before
After
Note
This PR also contains changes from #2605 which is about making it impossible to set a disabled work pattern as default.