diff --git a/core/includes/menu.inc b/core/includes/menu.inc index aeb0d8a..ff0c8a8 100644 --- a/core/includes/menu.inc +++ b/core/includes/menu.inc @@ -2123,6 +2123,7 @@ function menu_local_tasks($level = 0) { * @see contextual_links_preprocess() */ function menu_contextual_links($module, $parent_path, $args) { + //var_dump($parent_path); static $path_empty = array(); $links = array(); @@ -2133,16 +2134,17 @@ function menu_contextual_links($module, $parent_path, $args) { } // Construct the item-specific parent path. $path = $parent_path . '/' . implode('/', $args); - + //var_dump($path); // Get the router item for the given parent link path. $router_item = menu_get_item($path); +//var_dump($router_item); if (!$router_item || !$router_item['access']) { $path_empty[$parent_path] = TRUE; return $links; } $data = &drupal_static(__FUNCTION__, array()); $root_path = $router_item['path']; - +//var_dump($root_path); // Performance: For a single, normalized path (such as 'node/%') we only query // available tasks once per request. if (!isset($data[$root_path])) { @@ -2157,6 +2159,7 @@ function menu_contextual_links($module, $parent_path, $args) { ->orderBy('title') ->execute() ->fetchAllAssoc('path', PDO::FETCH_ASSOC); + } $parent_length = drupal_strlen($root_path) + 1; $map = $router_item['original_map']; diff --git a/core/modules/block/block.module b/core/modules/block/block.module index 4d942ed..f90eaea 100644 --- a/core/modules/block/block.module +++ b/core/modules/block/block.module @@ -911,6 +911,8 @@ function _block_get_renderable_block($element) { // Add the content renderable array to the main element. $element['content'] = $block->content; + if (isset($block->content['#contextual_links'])) + $element['#contextual_links'] = $block->content['#contextual_links']; unset($block->content); $element['#block'] = $block; } diff --git a/core/modules/contextual/contextual.module b/core/modules/contextual/contextual.module index 7b14a3f..a347a1c 100644 --- a/core/modules/contextual/contextual.module +++ b/core/modules/contextual/contextual.module @@ -82,6 +82,15 @@ function contextual_element_info() { * @see contextual_pre_render_links() */ function contextual_preprocess(&$variables, $hook) { + //echo '
'; + //echo 'variables'; + //var_dump($variables); + //echo ''; + /*echo '
'; + echo 'variables'; + var_dump($variables['page']['sidebar_first']); + echo ''; + exit();*/ // Nothing to do here if the user is not permitted to access contextual links. if (!user_access('access contextual links')) { return; @@ -111,6 +120,10 @@ function contextual_preprocess(&$variables, $hook) { // Mark this element as potentially having contextual links attached to it. $variables['classes_array'][] = 'contextual-links-region'; } + /*echo '
'; + var_dump($element); + echo ''; + exit();*/ } /** @@ -135,6 +148,9 @@ function contextual_preprocess(&$variables, $hook) { * @see contextual_element_info() */ function contextual_pre_render_links($element) { + /* echo '
'; + var_dump($element); + echo '';*/ // Retrieve contextual menu links. $items = array(); foreach ($element['#contextual_links'] as $module => $args) { diff --git a/core/modules/system/system.api.php b/core/modules/system/system.api.php index 5fc015e..b17c8fd 100644 --- a/core/modules/system/system.api.php +++ b/core/modules/system/system.api.php @@ -1090,6 +1090,7 @@ function hook_menu_breadcrumb_alter(&$active_trail, $item) { * @see contextual_preprocess() */ function hook_menu_contextual_links_alter(&$links, $router_item, $root_path) { + // Add a link to all contextual links for nodes. if ($root_path == 'node/%') { $links['foo'] = array( diff --git a/core/modules/trigger/trigger.admin.inc b/core/modules/trigger/trigger.admin.inc index 7509eb3..287486d 100644 --- a/core/modules/trigger/trigger.admin.inc +++ b/core/modules/trigger/trigger.admin.inc @@ -119,6 +119,7 @@ function trigger_assign_form($form, $form_state, $module, $hook, $label) { ); $form['hook'] = array( '#type' => 'hidden', + '#maxlength' => 64, '#value' => $hook, ); // All of these forms use the same validate and submit functions. diff --git a/core/modules/trigger/trigger.install b/core/modules/trigger/trigger.install index 7dded60..2c237e2 100644 --- a/core/modules/trigger/trigger.install +++ b/core/modules/trigger/trigger.install @@ -51,3 +51,11 @@ function trigger_install() { // Do initial synchronization of actions in code and the database. actions_synchronize(); } + +/** + * Implements hook_update_N(). + */ +function trigger_update_8001() { + db_drop_primary_key('trigger_assignments'); + db_change_field('trigger_assignments', 'hook', 'hook', array('type' => 'varchar', 'length' => 64, 'not null' => TRUE, 'default' => '', 'description' => 'Primary Key: The name of the internal Drupal hook; for example, node_insert.', ), array('primary key' => array('hook', 'aid'))); +}