Do not require project IDs for default profile forms
This commit is contained in:
parent
670984854f
commit
c7f1b7cb6e
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.
|
// Show warning when there is configuration missing for required fields.
|
||||||
$requiredConfig = CRM_Twingle_Profile::allowedAttributes(TRUE);
|
$requiredConfig = CRM_Twingle_Profile::allowedAttributes(TRUE);
|
||||||
foreach ($requiredConfig as $key => $metadata) {
|
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(
|
CRM_Core_Session::setStatus(
|
||||||
E::ts(
|
E::ts(
|
||||||
'The required configuration option "%1" has no value. Saving the profile might set this option to a possibly unwanted default value.',
|
'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