Commit befeb815 authored by jcnventura's avatar jcnventura

Fix #763810: Configure module weights to ensure that the core module is always...

Fix #763810: Configure module weights to ensure that the core module is always called before the others
parent 60fe300b
......@@ -18,6 +18,22 @@ function print_install() {
));
}
/**
* Implements hook_enable().
*/
function print_enable() {
$t = get_t();
// Module weight
db_update('system')
->fields(array(
'weight' => 0,
))
->condition('type', 'module')
->condition('name', 'print')
->execute();
}
/**
* Implements hook_uninstall().
*/
......@@ -138,3 +154,17 @@ function print_schema() {
return $schema;
}
/**
* Remove hardcoded numeric deltas from all blocks
*/
function print_update_7000(&$sandbox) {
$renamed_deltas = array(
'print' => array(
'0' => 'print links',
'1' => 'print top',
),
);
update_fix_d7_block_deltas($sandbox, $renamed_deltas, array());
}
......@@ -8,6 +8,22 @@
* @ingroup print
*/
/**
* Implements hook_enable().
*/
function print_mail_enable() {
$t = get_t();
// Module weight
db_update('system')
->fields(array(
'weight' => 1,
))
->condition('type', 'module')
->condition('name', 'print_mail')
->execute();
}
/**
* Implements hook_uninstall().
*/
......@@ -124,3 +140,16 @@ function print_mail_schema() {
return $schema;
}
/**
* Remove hardcoded numeric deltas from all blocks
*/
function print_mail_update_7000(&$sandbox) {
$renamed_deltas = array(
'print_mail' => array(
'0' => 'print_mail top',
),
);
update_fix_d7_block_deltas($sandbox, $renamed_deltas, array());
}
......@@ -8,6 +8,22 @@
* @ingroup print
*/
/**
* Implements hook_enable().
*/
function print_pdf_enable() {
$t = get_t();
// Module weight
db_update('system')
->fields(array(
'weight' => 2,
))
->condition('type', 'module')
->condition('name', 'print_pdf')
->execute();
}
/**
* Implements hook_uninstall().
*/
......@@ -111,3 +127,20 @@ function print_pdf_schema() {
return $schema;
}
/**
* Remove hardcoded numeric deltas from all blocks
*/
function print_pdf_update_7000(&$sandbox) {
$renamed_deltas = array(
'print_pdf' => array(
'0' => 'print_pdf top',
),
);
update_fix_d7_block_deltas($sandbox, $renamed_deltas, array());
if (variable_get('print_pdf_filename', '') == '[site-name] - [title] - [mod-yyyy]-[mod-mm]-[mod-dd]') {
variable_set('print_pdf_filename', '[site:name] - [node:title] - [node:changed]');
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment