protected static function GoogleAnalyticsAdminSettingsForm::validateCreateFieldValue in Google Analytics 8.2
Checks whether a candidate value is valid.
Parameters
string $value: The option value entered by the user.
Return value
string|null The error message if the specified value is invalid, NULL otherwise.
1 call to GoogleAnalyticsAdminSettingsForm::validateCreateFieldValue()
- GoogleAnalyticsAdminSettingsForm::validateCreateFieldValues in src/
Form/ GoogleAnalyticsAdminSettingsForm.php - The #element_validate callback for create only fields.
File
- src/
Form/ GoogleAnalyticsAdminSettingsForm.php, line 991
Class
- GoogleAnalyticsAdminSettingsForm
- Configure Google_Analytics settings for this site.
Namespace
Drupal\google_analytics\FormCode
protected static function validateCreateFieldValue($value) {
if (!is_bool($value) && !mb_strlen($value)) {
return t('A create only field requires a value.');
}
if (mb_strlen($value) > 255) {
return t('The value of a create only field must be a string at most 255 characters long.');
}
}