Merge branch 'defaultProfileProjectId'
[#90] Do not require project IDs for default profile forms
This commit is contained in:
commit
d1f3dd871c
1 changed files with 9 additions and 1 deletions
|
@ -571,7 +571,15 @@ class CRM_Twingle_Form_Profile extends CRM_Core_Form {
|
|||
// Show warning when there is configuration missing for required fields.
|
||||
$requiredConfig = CRM_Twingle_Profile::allowedAttributes(TRUE);
|
||||
foreach ($requiredConfig as $key => $metadata) {
|
||||
if (!isset($profile_data[$key]) && $metadata['required']) {
|
||||
$required = $metadata['required'] ?? FALSE;
|
||||
// Do not require twingle project IDs/selector for the default profile.
|
||||
if (
|
||||
$this->profile->is_default()
|
||||
&& 'selector' === $key
|
||||
) {
|
||||
$required = FALSE;
|
||||
}
|
||||
if (!isset($profile_data[$key]) && $required) {
|
||||
CRM_Core_Session::setStatus(
|
||||
E::ts(
|
||||
'The required configuration option "%1" has no value. Saving the profile might set this option to a possibly unwanted default value.',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue