Created
August 8, 2011 15:22
-
-
Save chrisns/1131944 to your computer and use it in GitHub Desktop.
workflow patch to disable static cache in initial migration
This file contains hidden or 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
diff --git workflow.module workflow.module | |
index de9becd..01b7033 100644 | |
--- workflow.module | |
+++ workflow.module | |
@@ -753,7 +753,10 @@ function workflow_node_current_state($node) { | |
* The ID of the workflow. | |
*/ | |
function _workflow_creation_state($wid) { | |
- static $cache; | |
+ global $initial_migration; | |
+ if (!$initial_migration) { | |
+ static $cache; | |
+ } | |
if (!isset($cache[$wid])) { | |
$result = db_result(db_query("SELECT sid FROM {workflow_states} WHERE wid = %d AND sysid = %d", $wid, WORKFLOW_CREATION)); | |
$cache[$wid] = $result; | |
@@ -981,7 +984,10 @@ function workflow_get_name($wid) { | |
* The ID of the workflow or FALSE if no workflow is mapped to this type. | |
*/ | |
function workflow_get_workflow_for_type($type) { | |
- static $cache; | |
+ global $initial_migration; | |
+ if (!$initial_migration) { | |
+ static $cache; | |
+ } | |
if(!isset($cache[$type])) { | |
$wid = db_result(db_query("SELECT wid FROM {workflow_type_map} WHERE type = '%s'", $type)); | |
$cache[$type] = $wid; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment