### Eclipse Workspace Patch 1.0 #P Drupal-7-HEAD Index: modules/dashboard/dashboard.module =================================================================== RCS file: /cvs/drupal/drupal/modules/dashboard/dashboard.module,v retrieving revision 1.41 diff -u -r1.41 dashboard.module --- modules/dashboard/dashboard.module 6 Nov 2010 23:24:33 -0000 1.41 +++ modules/dashboard/dashboard.module 17 Nov 2010 13:22:48 -0000 @@ -418,6 +418,19 @@ } /** + * Implements MODULE_preprocess_hook(). + */ +function dashboard_preprocess_block(&$variables) { + if (dashboard_is_visible()) { + // Since the transformations performed by drupal_html_id() are irreversible, + // rendering it impossible to use the CSS id to idenfify individual blocks, + // we add two classes to aid in identification. + $variables['classes_array'][] = 'module-' . $variables['block']->module; + $variables['classes_array'][] = 'delta-' . $variables['block']->delta; + } +} + +/** * Determines if the dashboard should be displayed on the current page. * * This function checks if the user is currently viewing the dashboard and has @@ -546,7 +559,7 @@ } foreach ($blocks as $weight => $block_string) { // Parse the query string to determine the block's module and delta. - preg_match('/block-([^-]+)-(.+)/', $block_string, $matches); + preg_match('/([^:]+):(.+)/', $block_string, $matches); $block = new stdClass(); $block->module = $matches[1]; $block->delta = $matches[2]; Index: modules/dashboard/dashboard.js =================================================================== RCS file: /cvs/drupal/drupal/modules/dashboard/dashboard.js,v retrieving revision 1.13 diff -u -r1.13 dashboard.js --- modules/dashboard/dashboard.js 8 Jun 2010 05:16:29 -0000 1.13 +++ modules/dashboard/dashboard.js 17 Nov 2010 13:22:47 -0000 @@ -208,7 +208,9 @@ var region = $(this).parent().attr('id').replace(/-/g, '_'); var blocks = $(this).sortable('toArray'); $.each(blocks, function() { - order.push(region + '[]=' + this); + var block_module = $('#' + this).attr('class').match(/\bmodule-(\S+)\b/)[1]; + var block_delta = $('#' + this).attr('class').match(/\bdelta-(\S+)\b/)[1]; + order.push(region + '[]=' + block_module + ':' + block_delta); }); }); order = order.join('&');