From 881f45aa775946ab2f4f0547246e397c858a76c3 Mon Sep 17 00:00:00 2001 From: Chris Gross <gross.364@osu.edu> Date: Wed, 27 Feb 2019 16:00:28 -0500 Subject: [PATCH] 7.x-1.12 Release Candidate 1 --- profiles/wcm_base/CHANGELOG.txt | 4 +++ .../modules/contrib/context/context.core.inc | 26 +++++++++++++++---- .../modules/contrib/context/context.info | 7 +++-- .../modules/contrib/context/context.module | 5 ++++ .../context_layouts/context_layouts.info | 7 +++-- .../context/context_ui/context_ui.info | 7 +++-- .../context_condition_query_string.inc | 2 +- .../plugins/context_reaction_block.inc | 21 ++++++++------- .../context/plugins/context_reaction_block.js | 2 +- .../plugins/context_reaction_region.inc | 6 ++++- profiles/wcm_base/wcm_base.make | 2 +- 11 files changed, 58 insertions(+), 31 deletions(-) diff --git a/profiles/wcm_base/CHANGELOG.txt b/profiles/wcm_base/CHANGELOG.txt index 2e43ca41..757f0833 100644 --- a/profiles/wcm_base/CHANGELOG.txt +++ b/profiles/wcm_base/CHANGELOG.txt @@ -1,3 +1,7 @@ +WCM Base 7.x-1.12-rc1, 2019-02-27 +--------------------------------- +- WCM Base: Updated Context to 3.10 per SA-CONTRIB-2019-028. + WCM Base 7.x-1.11, 2019-02-25 ----------------------------- - WCM Base: diff --git a/profiles/wcm_base/modules/contrib/context/context.core.inc b/profiles/wcm_base/modules/contrib/context/context.core.inc index 41ed93a5..9e198314 100644 --- a/profiles/wcm_base/modules/contrib/context/context.core.inc +++ b/profiles/wcm_base/modules/contrib/context/context.core.inc @@ -94,11 +94,27 @@ function context_theme_registry_alter(&$theme_registry) { */ function context_ctools_render_alter($info, $page, $data) { extract($data); - if ($page && in_array($task['name'], array('node_view', 'node_edit'), TRUE)) { - foreach ($contexts as $ctools_context) { - if (in_array('node', $ctools_context->type) && !empty($ctools_context->data)) { - context_node_condition($ctools_context->data, $task['name'] === 'node_view' ? 'view' : 'form'); - break; + + // Check for page handlers. + if ($page) { + // Check for node page handler. + if (in_array($task['name'], array('node_view', 'node_edit'), TRUE)) { + foreach ($contexts as $ctools_context) { + if (in_array('node', $ctools_context->type) && !empty($ctools_context->data)) { + context_node_condition($ctools_context->data, $task['name'] === 'node_view' ? 'view' : 'form'); + break; + } + } + } + // Check for taxonomy term page handler. + elseif (in_array($task['name'], array('term_view', 'term_edit'), TRUE)) { + foreach ($contexts as $ctools_context) { + if (in_array('taxonomy_term', $ctools_context->type) && !empty($ctools_context->data)) { + if ($plugin = context_get_plugin('condition', 'taxonomy_term')) { + $plugin->execute($ctools_context->data, $task['name'] === 'term_view' ? 'view' : 'form'); + } + break; + } } } } diff --git a/profiles/wcm_base/modules/contrib/context/context.info b/profiles/wcm_base/modules/contrib/context/context.info index 159f142a..eef3a9c1 100644 --- a/profiles/wcm_base/modules/contrib/context/context.info +++ b/profiles/wcm_base/modules/contrib/context/context.info @@ -8,9 +8,8 @@ files[] = tests/context.test files[] = tests/context.conditions.test files[] = tests/context.reactions.test -; Information added by Drupal.org packaging script on 2016-05-18 -version = "7.x-3.7" +; Information added by Drupal.org packaging script on 2019-02-26 +version = "7.x-3.10" core = "7.x" project = "context" -datestamp = "1463605446" - +datestamp = "1551220089" diff --git a/profiles/wcm_base/modules/contrib/context/context.module b/profiles/wcm_base/modules/contrib/context/context.module index 5c0bd5c8..c83b15ef 100644 --- a/profiles/wcm_base/modules/contrib/context/context.module +++ b/profiles/wcm_base/modules/contrib/context/context.module @@ -243,6 +243,11 @@ function context_preprocess_menu_link(&$variables) { // css class to the link of this menu. // - Do not add class twice on current page. if (in_array($variables['element']['#href'], $reaction_menu_paths) && $variables['element']['#href'] != $_GET['q']) { + // Initialize classes array if not set. + if (!isset($variables['element']['#localized_options']['attributes']['class'])) { + $variables['element']['#localized_options']['attributes']['class'] = array(); + } + // Do not add the 'active' class twice in views tabs. if (!in_array('active', $variables['element']['#localized_options']['attributes']['class'])) { $variables['element']['#localized_options']['attributes']['class'][] = 'active'; diff --git a/profiles/wcm_base/modules/contrib/context/context_layouts/context_layouts.info b/profiles/wcm_base/modules/contrib/context/context_layouts/context_layouts.info index 129c4cdb..65880e38 100644 --- a/profiles/wcm_base/modules/contrib/context/context_layouts/context_layouts.info +++ b/profiles/wcm_base/modules/contrib/context/context_layouts/context_layouts.info @@ -6,9 +6,8 @@ core = 7.x files[] = plugins/context_layouts_reaction_block.inc -; Information added by Drupal.org packaging script on 2016-05-18 -version = "7.x-3.7" +; Information added by Drupal.org packaging script on 2019-02-26 +version = "7.x-3.10" core = "7.x" project = "context" -datestamp = "1463605446" - +datestamp = "1551220089" diff --git a/profiles/wcm_base/modules/contrib/context/context_ui/context_ui.info b/profiles/wcm_base/modules/contrib/context/context_ui/context_ui.info index e6c51051..e5d17f8f 100644 --- a/profiles/wcm_base/modules/contrib/context/context_ui/context_ui.info +++ b/profiles/wcm_base/modules/contrib/context/context_ui/context_ui.info @@ -8,9 +8,8 @@ configure = admin/structure/context files[] = context.module files[] = tests/context_ui.test -; Information added by Drupal.org packaging script on 2016-05-18 -version = "7.x-3.7" +; Information added by Drupal.org packaging script on 2019-02-26 +version = "7.x-3.10" core = "7.x" project = "context" -datestamp = "1463605446" - +datestamp = "1551220089" diff --git a/profiles/wcm_base/modules/contrib/context/plugins/context_condition_query_string.inc b/profiles/wcm_base/modules/contrib/context/plugins/context_condition_query_string.inc index 781d4cbb..b7bf5d51 100644 --- a/profiles/wcm_base/modules/contrib/context/plugins/context_condition_query_string.inc +++ b/profiles/wcm_base/modules/contrib/context/plugins/context_condition_query_string.inc @@ -16,7 +16,7 @@ class context_condition_query_string extends context_condition_path { */ function execute() { if ($this->condition_used()) { - $current_query_string = $_SERVER["QUERY_STRING"]; + $current_query_string = empty($_SERVER["QUERY_STRING"]) ? '' : $_SERVER["QUERY_STRING"]; foreach ($this->get_contexts() as $context) { $query_strings = $this->fetch_from_context($context, 'values'); if ($this->match($current_query_string, $query_strings, TRUE)) { diff --git a/profiles/wcm_base/modules/contrib/context/plugins/context_reaction_block.inc b/profiles/wcm_base/modules/contrib/context/plugins/context_reaction_block.inc index abcafd87..90c005c6 100644 --- a/profiles/wcm_base/modules/contrib/context/plugins/context_reaction_block.inc +++ b/profiles/wcm_base/modules/contrib/context/plugins/context_reaction_block.inc @@ -400,13 +400,17 @@ class context_reaction_block extends context_reaction { unset($_context_blocks); foreach ($context_blocks as $r => $blocks) { - //only render blocks in an active region + // Only render blocks in an active region. if (array_key_exists($r, $active_regions)) { $context_blocks[$r] = _block_render_blocks($blocks); - // Make blocks editable if allowed. - if ($this->is_editable_region($r)) { - foreach ($context_blocks[$r] as $key => $block) { + $editable = $this->is_editable_region($r); + foreach ($context_blocks[$r] as $key => $block) { + // Add the region property to each block. + $context_blocks[$r][$key]->region = $r; + + // Make blocks editable if allowed. + if ($editable) { $context_blocks[$r][$key] = $this->editable_block($block); } } @@ -450,12 +454,9 @@ class context_reaction_block extends context_reaction { */ protected function max_block_weight() { $blocks = $this->get_blocks(); - $block_count = 0; - foreach ($blocks as $region => $block_list) { - $block_count += count($block_list); - } - // Add 2 to make sure there's space at either end of the block list - return round(($block_count + 2) / 2); + + // Add 2 to make sure there's space at either end of the block list. + return round((count($blocks) + 2) / 2); } /** diff --git a/profiles/wcm_base/modules/contrib/context/plugins/context_reaction_block.js b/profiles/wcm_base/modules/contrib/context/plugins/context_reaction_block.js index fb0f3f16..192b956f 100644 --- a/profiles/wcm_base/modules/contrib/context/plugins/context_reaction_block.js +++ b/profiles/wcm_base/modules/contrib/context/plugins/context_reaction_block.js @@ -68,7 +68,7 @@ DrupalContextBlockForm = function(blockForm) { // Hide enabled blocks from selector that are used $('table.context-blockform-region tr').each(function() { - var bid = $(this).attr('id'); + var bid = Drupal.checkPlain($(this).attr('id')); $('div.context-blockform-selector input[value="'+bid+'"]').parents('div.form-item').eq(0).hide(); }); // Show blocks in selector that are unused diff --git a/profiles/wcm_base/modules/contrib/context/plugins/context_reaction_region.inc b/profiles/wcm_base/modules/contrib/context/plugins/context_reaction_region.inc index c4f0fd7c..d9c0a8ed 100644 --- a/profiles/wcm_base/modules/contrib/context/plugins/context_reaction_region.inc +++ b/profiles/wcm_base/modules/contrib/context/plugins/context_reaction_region.inc @@ -17,7 +17,7 @@ class context_reaction_region extends context_reaction { '#type' => 'fieldset', '#title' => "Disable Regions in {$theme->name} Theme", '#collapsible' => TRUE, - '#collapsed' => !array_reduce($default, create_function('$a, $b', 'return $a || $b;')), + '#collapsed' => !array_reduce($default, 'context_reaction_region::collapseRegion'), ); $form[$theme->name]['disable'] = array( '#type' => 'checkboxes', @@ -29,6 +29,10 @@ class context_reaction_region extends context_reaction { } return $form; } + + function collapseRegion($a, $b) { + return $a || $b; + } function execute(&$page) { global $theme; diff --git a/profiles/wcm_base/wcm_base.make b/profiles/wcm_base/wcm_base.make index d9df5b3e..68b6527a 100644 --- a/profiles/wcm_base/wcm_base.make +++ b/profiles/wcm_base/wcm_base.make @@ -14,7 +14,7 @@ projects[calendar][subdir] = contrib projects[conditional_fields][version] = 3.0-alpha2 projects[conditional_fields][subdir] = contrib -projects[context][version] = 3.7 +projects[context][version] = 3.10 projects[context][subdir] = contrib projects[context_omega][version] = 1.1 -- GitLab