Modifying weight blocks in context

17/01/2016

In Drupal 7:

/**
* Implements hook_context_load_alter().
*/
function MODULE_context_load_alter(&$context) {
  if($context->name === 'CONTEXT_NAME'  && isset($context->reactions['block'])){
    $context->reactions['block']['blocks']['BLOCK_NAME']['weight'] = -1;
  }
}