Skip to content
Browse files

Fixed group template didn't hide for the "none" group method on the R…

…ules action form after last changes; Fixed WSODs due to the fact that language_list() returns an array of language objects rather than of language arrays
  • Loading branch information...
1 parent 5beff8a commit db24fd335e14ed31af3af216a36f84364053e2f5 @IceCreamYou committed Jul 8, 2011
Showing with 17 additions and 9 deletions.
  1. +3 −3 activity_log.admin.js
  2. +14 −6 activity_log.rules.inc
View
6 activity_log.admin.js
@@ -25,23 +25,23 @@ Drupal.behaviors.activityLogAdmin = function (context) {
ctxt.find('#edit-settings-grouping-group-max-wrapper').hide();
ctxt.find('#edit-settings-grouping-group-summary-wrapper').hide();
ctxt.find('#edit-settings-grouping-collapse-method-wrapper').hide();
- ctxt.find('#edit-settings-grouping-group-template-wrapper').show();
+ ctxt.find('#edit-settings-grouping-templates-fieldset').show();
ctxt.find('.activity-log-admin-description').hide();
}
else if (val == 'action' || val == 'user_action') {
ctxt.find('#edit-settings-grouping-group-interval-wrapper').show();
ctxt.find('#edit-settings-grouping-group-max-wrapper').show();
ctxt.find('#edit-settings-grouping-group-summary-wrapper').show();
ctxt.find('#edit-settings-grouping-collapse-method-wrapper').show();
- ctxt.find('#edit-settings-grouping-group-template-wrapper').show();
+ ctxt.find('#edit-settings-grouping-templates-fieldset').show();
ctxt.find('.activity-log-admin-description').show();
}
else if (val == 'none') {
ctxt.find('#edit-settings-grouping-group-interval-wrapper').hide();
ctxt.find('#edit-settings-grouping-group-max-wrapper').hide();
ctxt.find('#edit-settings-grouping-group-summary-wrapper').hide();
ctxt.find('#edit-settings-grouping-collapse-method-wrapper').hide();
- ctxt.find('#edit-settings-grouping-group-template-wrapper').hide();
+ ctxt.find('#edit-settings-grouping-templates-fieldset').hide();
}
acting_uid['group_method'] = (val == 'user_action');
toggle_acting_uid();
View
20 activity_log.rules.inc
@@ -55,18 +55,22 @@ function activity_log_log_action_form($settings, &$form) {
'#title' => t('Language templates'),
'#description' => t('Set the localized templates for messages for this activity type.') .' '.
t("If a language has no translation, it will fall back to the template for the site's default language."),
- ) : array();
+ '#attributes' => array('id' => 'edit-settings-templates-fieldset'),
+ ) : array(
+ '#prefix' => '<div id="edit-settings-templates-fieldset">',
+ '#suffix' => '</div>',
+ );
foreach ($languages as $name => $lang) {
$is_default = language_default('language') == $name;
$form['settings']['templates'][$name] = array(
'#type' => 'fieldset',
- '#title' => $lang['name'],
+ '#title' => $lang->name,
'#collapsible' => !$is_default || $translate,
'#collapsed' => !$is_default,
);
$form['settings']['templates'][$name]['template'] = array(
'#type' => 'textarea',
- '#title' => t('@lang activity message template', array('@lang' => $lang['name'])),
+ '#title' => t('@lang activity message template', array('@lang' => $lang->name)),
'#default_value' => $settings['templates'][$name]['template'],
'#rows' => 3,
'#required' => $is_default,
@@ -137,18 +141,22 @@ function activity_log_log_action_form($settings, &$form) {
'#title' => t('Language templates'),
'#description' => t('Set the localized templates for grouped messages for this activity type.') .' '.
t("If a language has no translation, it will fall back to the template for the site's default language."),
- ) : array();
+ '#attributes' => array('id' => 'edit-settings-grouping-templates-fieldset'),
+ ) : array(
+ '#prefix' => '<div id="edit-settings-grouping-templates-fieldset">',
+ '#suffix' => '</div>',
+ );
foreach ($languages as $name => $lang) {
$is_default = language_default('language') == $name;
$form['settings']['grouping']['templates'][$name] = array(
'#type' => 'fieldset',
- '#title' => $lang['name'],
+ '#title' => $lang->name,
'#collapsible' => !$is_default || $translate,
'#collapsed' => !$is_default,
);
$form['settings']['grouping']['templates'][$name]['template'] = array(
'#type' => 'textarea',
- '#title' => t('@lang grouped message template', array('@lang' => $lang['name'])),
+ '#title' => t('@lang grouped message template', array('@lang' => $lang->name)),
'#default_value' => $settings['grouping']['templates'][$name]['template'],
'#rows' => 3,
'#description' => '<p>'. t('The format of the grouped message.') .' '.

0 comments on commit db24fd3

Please sign in to comment.
Something went wrong with that request. Please try again.