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

nancydru’s picture

Status: Active » Fixed

You are right, that was definitely an error. I gave you credit on the commit.

martysteer’s picture

No need for that! you folks have done all the work on this great module! :)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

correct line number