diff --git a/sites/all/modules/contrib/fields/field_group/CHANGELOG.txt b/sites/all/modules/contrib/fields/field_group/CHANGELOG.txt index 5e3ea36f..ea037d87 100644 --- a/sites/all/modules/contrib/fields/field_group/CHANGELOG.txt +++ b/sites/all/modules/contrib/fields/field_group/CHANGELOG.txt @@ -1,6 +1,27 @@ /* $Id*/ CHANGELOG for field_group for Drupal 7 +Field_group 7.x-1.4 + o Issue #2129805 by RaF: Incorrect markup when open div & custom classes provided. + o Issue #2037731 by maximpodorov, Zach Harkey: Remove id attribute from HTML elements. + o Issue #2099505 by borisson_ | Maks: Warning: Invalid argument supplied for foreach() in field_group_build_entity_groups() (line 1894 ..sites/all/modules/field_group. + o Issue #2102397 by thebruce: Field Group 7006 update fails with "Cannot use string offset as an array in /field_group/field_group.install on line 318. + o Issue #2122733 by Alan D.: Remove test module from admin listing. + o Issue #2212431 by tim.plunkett: Field groups that contain only elements that use #markup are hidden. + o Issue #2175731 by tobiasb, daggerhart: HTML produced by module is broken. + o Issue #2190425 by tobiasb: Fix attach behavior. + o Issue #1911530 by tobiasb, Simon Georges: Remove useless files[] directive from .info files. + o Issue #1358430 by oushen, tobiasb | FriedJam: JS "Error: uncaught exception: Syntax error, unrecognized expression:". + o Issue #2104391 by mike_san: Package descriptions. + o Issue #2189777 by gmercer: Exporting a feature with field groups sometimes leads to $field_group->data being set to an empty string. + o Issue #2168689 by Paul B: Beïng should be being. + o Issue #2037731 by rreiss, maximpodorov, Zach Harkey: Make id attribute optional. Current installations will default get the old ids + o Issue #2173351 by axe312: Add a label to html-element wrappers. + o Issue #1954056 by klonos: Proper capitalization in the project name. + o Issue #2224547 by sdrycroft: Fixed field_group_info_groups() clears all CTools caches when it should only clear the field_group caches. + o Issue #2099505 by joelpittet, borisson_ | Maks: Fixed Warning: Invalid argument supplied for foreach() in field_group_build_entity_groups() (line 1894 ..sites/all/modules/field_group. + o Issue #2223269 by barraponto: Fixed Don't filter and translate empty strings. + Field_group 7.x-1.3 o Issue #2077695 by FreekVR | ChoY: Fixed field group entity display bug after update. o Issue #2078201 by DeFr, eneko1907 | cmriley: Fixed Started getting a ton of notices. diff --git a/sites/all/modules/contrib/fields/field_group/field_group.css b/sites/all/modules/contrib/fields/field_group/field_group.css deleted file mode 100644 index d47f0079..00000000 --- a/sites/all/modules/contrib/fields/field_group/field_group.css +++ /dev/null @@ -1,23 +0,0 @@ -/* $Id: field_group.css,v 1.1.2.12 2010/12/22 22:22:35 stalski Exp $ */ - -/** - * Fix for fieldsets in vertical tabs. - * Note that this can only be hardcoded to the Seven theme - * where people who override this, are in trouble. - * This can be removed in next d7 release. - */ -.vertical-tabs fieldset.default-fallback, -div.field-group-tabs-wrapper div.field-type-image fieldset, -div.field-group-tabs-wrapper div.field-type-file fieldset, -div.field-group-tabs-wrapper div.field-type-datetime fieldset { - border: 1px solid #CCCCCC; - margin: 1em 0; - padding: 2.5em 0 0; - position: relative; -} - -div.field-group-tabs-wrapper div.field-type-image legend, -div.field-group-tabs-wrapper div.field-type-file legend, -div.field-group-tabs-wrapper div.field-type-datetime legend { - display: block; -} \ No newline at end of file diff --git a/sites/all/modules/contrib/fields/field_group/field_group.field_ui.inc b/sites/all/modules/contrib/fields/field_group/field_group.field_ui.inc index 557b0c64..8872e386 100644 --- a/sites/all/modules/contrib/fields/field_group/field_group.field_ui.inc +++ b/sites/all/modules/contrib/fields/field_group/field_group.field_ui.inc @@ -222,7 +222,7 @@ function field_group_field_ui_overview_form_alter(&$form, &$form_state, $display $table[$name]['format']['type']['#attributes']['class'] = array('element-invisible'); } else { - // After saving, the settings are updated here aswell. First we create + // After saving, the settings are updated here as well. First we create // the element for the table cell. $table[$name]['settings_summary'] = array('#markup' => ''); if (!empty($group->format_settings)) { diff --git a/sites/all/modules/contrib/fields/field_group/field_group.info b/sites/all/modules/contrib/fields/field_group/field_group.info index 96a60539..912b55f7 100644 --- a/sites/all/modules/contrib/fields/field_group/field_group.info +++ b/sites/all/modules/contrib/fields/field_group/field_group.info @@ -6,9 +6,9 @@ dependencies[] = ctools core = 7.x files[] = tests/field_group.ui.test files[] = tests/field_group.display.test -; Information added by Drupal.org packaging script on 2014-06-04 -version = "7.x-1.4" +; Information added by Drupal.org packaging script on 2016-02-28 +version = "7.x-1.5+2-dev" core = "7.x" project = "field_group" -datestamp = "1401918529" +datestamp = "1456658044" diff --git a/sites/all/modules/contrib/fields/field_group/field_group.install b/sites/all/modules/contrib/fields/field_group/field_group.install index fa5371da..a7bb85ce 100644 --- a/sites/all/modules/contrib/fields/field_group/field_group.install +++ b/sites/all/modules/contrib/fields/field_group/field_group.install @@ -17,6 +17,7 @@ function field_group_schema() { 'key' => 'identifier', 'identifier' => 'field_group', 'default hook' => 'field_group_info', + 'load callback' => 'field_group_group_load_by_identifier', 'save callback' => 'field_group_group_save', 'delete callback' => 'field_group_group_export_delete', 'can disable' => TRUE, @@ -229,6 +230,8 @@ function field_group_update_7001() { ->condition('name', 'field_group') ->execute(); + // Clear drupal and static cache. + field_group_info_groups(NULL, NULL, NULL, TRUE); } /** @@ -246,6 +249,8 @@ function field_group_update_7002() { // See http://drupal.org/node/1018550. _field_group_recreate_identifiers(); + // Clear drupal and static cache. + field_group_info_groups(NULL, NULL, NULL, TRUE); } /** @@ -257,6 +262,8 @@ function field_group_update_7003() { module_load_include('module', 'field_group'); _field_group_recreate_identifiers(); + // Clear drupal and static cache. + field_group_info_groups(NULL, NULL, NULL, TRUE); } /** @@ -295,6 +302,8 @@ function field_group_update_7005() { drupal_write_record('field_group', $row, array('id')); } + // Clear drupal and static cache. + field_group_info_groups(NULL, NULL, NULL, TRUE); } /** @@ -330,6 +339,8 @@ function field_group_update_7006() { } } + // Clear drupal and static cache. + field_group_info_groups(NULL, NULL, NULL, TRUE); } /** @@ -344,8 +355,18 @@ function field_group_update_7007() { // Migrate the field groups so they have a unique identifier. $field_groups = ctools_export_load_object("field_group"); foreach ($field_groups as $row) { - if ($row->data['format_type'] == 'div' || $row->data['format_type'] == 'html5' || $row->data['format_type'] == 'html-element') { + // These field group types have an ID setting to populate. + $populate_id_setting = array( + 'html-element', + 'div', + 'html5', + 'fieldset', + 'tabs', + 'htabs', + 'accordion', + ); + if (in_array($row->data['format_type'], $populate_id_setting)) { // If mode is default, we don't know what view mode it was. Take full then. $view_mode = $row->mode == 'default' ? 'full' : $row->mode; $id = $row->entity_type . '_' . $row->bundle . '_' . $view_mode . '_' . $row->group_name; @@ -360,4 +381,14 @@ function field_group_update_7007() { drupal_write_record('field_group', $row, array('id')); } } + + // Clear drupal and static cache. + field_group_info_groups(NULL, NULL, NULL, TRUE); } + +/** + * Clear cache to notice the CTools load callback. + */ +function field_group_update_7008() { + drupal_flush_all_caches(); +} \ No newline at end of file diff --git a/sites/all/modules/contrib/fields/field_group/field_group.js b/sites/all/modules/contrib/fields/field_group/field_group.js index eef6aaaf..0b0a565b 100644 --- a/sites/all/modules/contrib/fields/field_group/field_group.js +++ b/sites/all/modules/contrib/fields/field_group/field_group.js @@ -41,9 +41,17 @@ Drupal.FieldGroup.Effects.processAccordion = { $('div.field-group-accordion-wrapper', context).once('fieldgroup-effects', function () { var wrapper = $(this); + // Get the index to set active. + var active_index = false; + wrapper.find('.accordion-item').each(function(i) { + if ($(this).hasClass('field-group-accordion-active')) { + active_index = i; + } + }); + wrapper.accordion({ - autoHeight: false, - active: '.field-group-accordion-active', + heightStyle: "content", + active: active_index, collapsible: true, changestart: function(event, ui) { if ($(this).hasClass('effect-none')) { @@ -111,6 +119,9 @@ Drupal.FieldGroup.Effects.processHtabs = { Drupal.FieldGroup.Effects.processTabs = { execute: function (context, settings, type) { if (type == 'form') { + + var errorFocussed = false; + // Add required fields mark to any fieldsets containing required fields $('fieldset.vertical-tabs-pane', context).once('fieldgroup-effects', function(i) { if ($(this).is('.required-fields') && $(this).find('.form-required').length > 0) { @@ -118,8 +129,12 @@ Drupal.FieldGroup.Effects.processTabs = { } if ($('.error', $(this)).length) { $(this).data('verticalTab').link.parent().addClass('error'); - Drupal.FieldGroup.setGroupWithfocus($(this)); - $(this).data('verticalTab').focus(); + // Focus the first tab with error. + if (!errorFocussed) { + Drupal.FieldGroup.setGroupWithfocus($(this)); + $(this).data('verticalTab').focus(); + errorFocussed = true; + } } }); } @@ -202,15 +217,14 @@ Drupal.behaviors.fieldGroup = { $('.fieldset-wrapper .fieldset > legend').css({display: 'block'}); $('.vertical-tabs fieldset.fieldset').addClass('default-fallback'); - // Add a new ID to each fieldset. - $('.group-wrapper fieldset').each(function() { + $('.group-wrapper .horizontal-tabs-panes > fieldset', context).once('group-wrapper-panes-processed', function() { // Tats bad, but we have to keep the actual id to prevent layouts to break. - var fieldgorupID = 'field_group-' + $(this).attr('id') + ' ' + $(this).attr('id'); - $(this).attr('id', fieldgorupID); - }) + var fieldgroupID = 'field_group-' + $(this).attr('id'); + $(this).attr('id', fieldgroupID); + }); // Set the hash in url to remember last userselection. - $('.group-wrapper ul li').each(function() { + $('.group-wrapper ul li').once('group-wrapper-ul-processed', function() { var fieldGroupNavigationListIndex = $(this).index(); $(this).children('a').click(function() { var fieldset = $('.group-wrapper fieldset').get(fieldGroupNavigationListIndex); @@ -219,7 +233,8 @@ Drupal.behaviors.fieldGroup = { window.location.hash = hashUrl; }); }); + } }; -})(jQuery); \ No newline at end of file +})(jQuery); diff --git a/sites/all/modules/contrib/fields/field_group/field_group.module b/sites/all/modules/contrib/fields/field_group/field_group.module index da1a791a..4061519f 100644 --- a/sites/all/modules/contrib/fields/field_group/field_group.module +++ b/sites/all/modules/contrib/fields/field_group/field_group.module @@ -122,6 +122,20 @@ function field_group_menu_load($group_name, $entity_type, $bundle_name, $bundle_ return empty($group) ? FALSE : $group; } +/** + * Ctools load callback to load fieldgroup by identifier. + */ +function field_group_load_field_group_by_identifier($identifier) { + + $parts = explode('|', $identifier); + if (count($parts) != 4) { + return; + } + + return field_group_load_field_group($parts[0], $parts[1], $parts[2], $parts[3]); + +} + /** * Loads a group definition. * @@ -292,7 +306,7 @@ function field_group_field_group_formatter_info() { 'html-element' => array( 'label' => t('HTML element'), 'description' => t('This fieldgroup renders the inner content in a HTML element with classes and attributes.'), - 'instance_settings' => array('element' => 'div', 'show_label' => 0, 'label_element' => 'div', 'classes' => '', 'attributes' => '', 'required_fields' => 1), + 'instance_settings' => array('element' => 'div', 'show_label' => 0, 'label_element' => 'div', 'classes' => '', 'attributes' => '', 'required_fields' => 1, 'id' => ''), ), 'div' => array( 'label' => t('Div'), @@ -310,13 +324,13 @@ function field_group_field_group_formatter_info() { 'label' => t('Fieldset'), 'description' => t('This fieldgroup renders the inner content in a fieldset with the title as legend.'), 'format_types' => array('open', 'collapsible', 'collapsed'), - 'instance_settings' => array('description' => '', 'classes' => '', 'required_fields' => 1), + 'instance_settings' => array('description' => '', 'classes' => '', 'required_fields' => 1, 'id' => ''), 'default_formatter' => 'collapsible', ), 'tabs' => array( 'label' => t('Vertical tabs group'), 'description' => t('This fieldgroup renders child groups in its own vertical tabs wrapper.'), - 'instance_settings' => array('classes' => ''), + 'instance_settings' => array('classes' => '', 'id' => ''), ), 'tab' => array( 'label' => t('Vertical tab'), @@ -328,14 +342,14 @@ function field_group_field_group_formatter_info() { 'htabs' => array( 'label' => t('Horizontal tabs group'), 'description' => t('This fieldgroup renders child groups in its own horizontal tabs wrapper.'), - 'instance_settings' => array('classes' => ''), + 'instance_settings' => array('classes' => '', 'id' => ''), ), 'htab' => array( 'label' => t('Horizontal tab'), 'format_types' => array('open', 'closed'), 'description' => t('This fieldgroup renders the content in a fieldset, part of horizontal tabs group.'), 'default_formatter' => 'closed', - 'instance_settings' => array('description' => '', 'classes' => '', 'required_fields' => 1, 'id' => ''), + 'instance_settings' => array('description' => '', 'classes' => '', 'required_fields' => 1), ), 'multipage-group' => array( 'label' => t('Multipage group'), @@ -352,7 +366,7 @@ function field_group_field_group_formatter_info() { 'accordion' => array( 'label' => t('Accordion group'), 'description' => t('This fieldgroup renders child groups as jQuery accordion.'), - 'instance_settings' => array('effect' => 'none', 'classes' => ''), + 'instance_settings' => array('effect' => 'none', 'classes' => '', 'id' => ''), ), 'accordion-item' => array( 'label' => t('Accordion item'), @@ -366,7 +380,7 @@ function field_group_field_group_formatter_info() { 'html-element' => array( 'label' => t('HTML element'), 'description' => t('This fieldgroup renders the inner content in a HTML element with classes and attributes.'), - 'instance_settings' => array('element' => 'div', 'show_label' => 0, 'label_element' => 'div', 'classes' => '', 'attributes' => '', 'required_fields' => 1), + 'instance_settings' => array('element' => 'div', 'show_label' => 0, 'label_element' => 'div', 'classes' => '', 'attributes' => '', 'required_fields' => 1, 'id' => ''), ), 'div' => array( 'label' => t('Div'), @@ -384,13 +398,13 @@ function field_group_field_group_formatter_info() { 'label' => t('Fieldset'), 'description' => t('This fieldgroup renders the inner content in a fieldset with the title as legend.'), 'format_types' => array('open', 'collapsible', 'collapsed'), - 'instance_settings' => array('description' => '', 'classes' => ''), + 'instance_settings' => array('description' => '', 'classes' => '', 'id' => ''), 'default_formatter' => 'collapsible', ), 'tabs' => array( 'label' => t('Vertical tabs group'), 'description' => t('This fieldgroup renders child groups in its own vertical tabs wrapper.'), - 'instance_settings' => array('classes' => ''), + 'instance_settings' => array('classes' => '', 'id' => ''), ), 'tab' => array( 'label' => t('Vertical tab'), @@ -402,7 +416,7 @@ function field_group_field_group_formatter_info() { 'htabs' => array( 'label' => t('Horizontal tabs group'), 'description' => t('This fieldgroup renders child groups in its own horizontal tabs wrapper.'), - 'instance_settings' => array('classes' => ''), + 'instance_settings' => array('classes' => '', 'id' => ''), ), 'htab' => array( 'label' => t('Horizontal tab item'), @@ -414,7 +428,7 @@ function field_group_field_group_formatter_info() { 'accordion' => array( 'label' => t('Accordion group'), 'description' => t('This fieldgroup renders child groups as jQuery accordion.'), - 'instance_settings' => array('description' => '', 'classes' => '', 'effect' => 'bounceslide'), + 'instance_settings' => array('description' => '', 'classes' => '', 'effect' => 'bounceslide', 'id' => ''), ), 'accordion-item' => array( 'label' => t('Accordion item'), @@ -706,12 +720,12 @@ function field_group_pre_render_html_element(&$element, $group, &$form) { $html_element = isset($group->format_settings['instance_settings']['element']) ? $group->format_settings['instance_settings']['element'] : 'div'; $show_label = isset($group->format_settings['instance_settings']['show_label']) ? $group->format_settings['instance_settings']['show_label'] : 0; $label_element = isset($group->format_settings['instance_settings']['label_element']) ? $group->format_settings['instance_settings']['label_element'] : 'div'; - $attributes = isset($group->format_settings['instance_settings']['attributes']) ? ' ' . $group->format_settings['instance_settings']['attributes'] : ''; + $configured_attributes = isset($group->format_settings['instance_settings']['attributes']) ? ' ' . $group->format_settings['instance_settings']['attributes'] : ''; $group->classes = trim($group->classes); // This regex split the attributes string so that we can pass that // later to drupal_attributes(). - preg_match_all('/([^\s=]+)="([^"]+)"/', $attributes, $matches); + preg_match_all('/([^\s=]+)="([^"]+)"/', $configured_attributes, $matches); $element_attributes = array(); // Put the attribute and the value together. @@ -727,7 +741,13 @@ function field_group_pre_render_html_element(&$element, $group, &$form) { $element_attributes['class'] .= ' ' . $group->classes; } - $attributes = drupal_attributes($element_attributes); + if (isset($element['#id'])) { + $element_attributes['id'] = $element['#id']; + } + + // Sanitize the attributes. + $element_attributes = _filter_xss_attributes(drupal_attributes($element_attributes)); + $attributes = $element_attributes ? ' ' . implode(' ', $element_attributes) : ''; $element['#prefix'] = '<' . $html_element . $attributes . '>'; if ($show_label) { @@ -810,9 +830,11 @@ function field_group_pre_render_accordion(&$element, $group, &$form) { // Add the jQuery UI accordion. $element['#attached']['library'][] = array('system', 'ui.accordion'); + $id = !empty($element['#id']) ? ' id="' . $element['#id'] . '"' : ''; + $element += array( '#type' => 'markup', - '#prefix' => '