After using the previous 7.x-1.x-rc1 version and creating some rules which use the 'Check workflow transition' action, I upgraded to 7.x-1.1 recently and my rules broke. The errors I was getting when running rules were like:
PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'workflow_states' doesn't exist: SELECT sid, state FROM {workflow_states} WHERE wid = (SELECT wid FROM workflow_states WHERE sid = :sid AND status = 1 AND sysid = 0) ; Array ( [:sid] => 4 ) in workflow_get_other_states_by_sid() (line 1347 of /docroot/mysite/sites/default/modules/contrib/workflow/workflow.module).
Checking the code, there's a new function in workflow.module workflow_get_other_states_by_sid, which has an error in it's SQL. I use table prefixing with my drupal installs, and this query needs the curly braces on line 1395 around workflow_states to resolve the table prefixes:
change line 1345 from:
. "WHERE wid = (SELECT wid FROM workflow_states WHERE sid = :sid AND status = 1 AND sysid = 0) "
to:
. "WHERE wid = (SELECT wid FROM {workflow_states} WHERE sid = :sid AND status = 1 AND sysid = 0) "
If I add these, my rules work again. Sorry... I can't create patches easily. :(
Comments
Comment #1
nancydruYou are right, that was definitely an error. I gave you credit on the commit.
Comment #2
martysteer commentedNo need for that! you folks have done all the work on this great module! :)
Comment #3.0
(not verified) commentedcorrect line number