updated webform, webform_localization, profile2, term_merge, search_api_saved_pages, rules, redirect, overide_node_options
This commit is contained in:
@@ -274,7 +274,11 @@ function token_form_block_admin_configure_alter(&$form, $form_state) {
|
||||
*/
|
||||
function token_field_widget_form_alter(&$element, &$form_state, $context) {
|
||||
if (!empty($element['#description']) && !empty($context['instance']['description'])) {
|
||||
$element['#description'] = filter_xss_admin(token_replace($context['instance']['description']));
|
||||
$instance = $context['instance'];
|
||||
if (module_exists('i18n_field')) {
|
||||
$instance = i18n_string_object_translate('field_instance', $instance);
|
||||
}
|
||||
$element['#description'] = field_filter_xss(token_replace($instance['description']));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -719,15 +723,13 @@ function token_element_validate(&$element, &$form_state) {
|
||||
|
||||
// Validate if an element must have a minimum number of tokens.
|
||||
if (isset($element['#min_tokens']) && count($tokens) < $element['#min_tokens']) {
|
||||
// @todo Change this error message to include the minimum number.
|
||||
$error = format_plural($element['#min_tokens'], 'The %element-title cannot contain fewer than one token.', 'The %element-title must contain at least @count tokens.', array('%element-title' => $title));
|
||||
$error = format_plural($element['#min_tokens'], '%name must contain at least one token.', '%name must contain at least @count tokens.', array('%name' => $title));
|
||||
form_error($element, $error);
|
||||
}
|
||||
|
||||
// Validate if an element must have a maximum number of tokens.
|
||||
if (isset($element['#max_tokens']) && count($tokens) > $element['#max_tokens']) {
|
||||
// @todo Change this error message to include the maximum number.
|
||||
$error = format_plural($element['#max_tokens'], 'The %element-title must contain as most one token.', 'The %element-title must contain at most @count tokens.', array('%element-title' => $title));
|
||||
$error = format_plural($element['#max_tokens'], '%name must contain at most one token.', '%name must contain at most @count tokens.', array('%name' => $title));
|
||||
form_error($element, $error);
|
||||
}
|
||||
|
||||
@@ -735,7 +737,7 @@ function token_element_validate(&$element, &$form_state) {
|
||||
if (isset($element['#token_types'])) {
|
||||
$invalid_tokens = token_get_invalid_tokens_by_context($tokens, $element['#token_types']);
|
||||
if ($invalid_tokens) {
|
||||
form_error($element, t('The %element-title is using the following invalid tokens: @invalid-tokens.', array('%element-title' => $title, '@invalid-tokens' => implode(', ', $invalid_tokens))));
|
||||
form_error($element, t('%name is using the following invalid tokens: @invalid-tokens.', array('%name' => $title, '@invalid-tokens' => implode(', ', $invalid_tokens))));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -983,7 +985,7 @@ function _token_build_tree($token_type, array $options) {
|
||||
// parent.
|
||||
$token_parents[] = $token_type;
|
||||
}
|
||||
elseif (in_array($token, array_slice($token_parents, 1))) {
|
||||
elseif (in_array($token, array_slice($token_parents, 1), TRUE)) {
|
||||
// Prevent duplicate recursive tokens. For example, this will prevent
|
||||
// the tree from generating the following tokens or deeper:
|
||||
// [comment:parent:parent]
|
||||
|
||||
Reference in New Issue
Block a user