Created
January 18, 2012 09:39
-
-
Save opi/1632184 to your computer and use it in GitHub Desktop.
Drupal 6 Update block cache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function mymodule_update_N() { | |
$return = array(); | |
$blocks = mymodule_block('list'); | |
foreach($blocks as $delta => $block) { | |
$cache = ($block['cache']) ? $block['cache'] : BLOCK_CACHE_PER_ROLE; | |
$return[] = update_sql('UPDATE {blocks} SET cache = '.$cache.' WHERE module = "mymodule" AND delta = "'.$delta.'" '); | |
} | |
return $return; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function mymodule_update_N() { | |
$return = array(); | |
$blocks = mymodule_block('list'); | |
foreach($blocks as $delta => $block) { | |
$cache = ($block['cache']) ? $block['cache'] : BLOCK_CACHE_PER_ROLE; | |
$return[] = update_sql('UPDATE {blocks} SET cache = '.$cache.' WHERE module = "mymodule" AND delta = "'.$delta.'" '); | |
} | |
return $return; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment