When I use I get a general syntax error in sql query in workflow_allowable_transitions function. The first syntax error is dealing with the first parenthesis. The second syntax error is dealing with an ORDER BY before the UNION.
I've attached a patch to fix these issues with Sqlite.
| Comment | File | Size | Author |
|---|---|---|---|
| syntax_error_with_sqlite.patch | 1.27 KB | daveparrish |
Comments
Comment #1
katannshaw commentedDrupal 7.12
SQL Server Driver for Drupal 7
PHP 5.3
IIS 7.5
After assigning a simple Draft-Done "Workflow" to a content type from the documentation, I receive this error when trying to "Add Content":
PDOException: SQLSTATE[07002]: [Microsoft][SQL Server Native Client 10.0]COUNT field incorrect or syntax error: (SELECT t.tid, t.target_sid as state_id, s.state AS state_name, s.weight AS state_weight FROM {workflow_transitions} t INNER JOIN {workflow_states} s ON s.sid = t.target_sid WHERE t.sid = :sid AND s.status = 1 ORDER BY state_weight) UNION (SELECT s.sid as tid, s.sid as state_id, s.state as state_name, s.weight as state_weight FROM {workflow_states} s WHERE s.sid = :sid AND s.status = 1) ORDER BY state_weight, state_id; Array ( [:sid] => 1 ) in workflow_allowable_transitions() (line 1336 of C:\Users\USERNAME\Documents\My Web Sites\Drupal 7\sites\all\modules\workflow\workflow.module).
Trying to delete the "Draft-Done" workflow results in this error:
PDOException: SQLSTATE[07002]: [Microsoft][SQL Server Native Client 10.0]COUNT field incorrect or syntax error: SELECT * FROM {workflow_transitions} WHERE sid = :sid OR target_sid = :sid; Array ( [:sid] => 1 ) in workflow_get_workflow_transitions_by_sid_involved() (line 1065 of C:\Users\USERNAME\Documents\My Web Sites\Drupal 7\sites\all\modules\workflow\workflow.module).
The only solution for now is to disable the Workflow module. Is this the same issue that you're referring to, or should I start a new issue?
Comment #2
daveparrish commentedYes, sorry, I should have explained my error I was getting. That looks similar to error I had.
Of course, my error was with Sqlite. I am not sure if the patch fixes the issue for MS SQL.
Comment #3
katannshaw commentedOk, thanks dave. I'll look into installing the patch to see if it fixes things for me. I am a newbie though. Do you have a good reference article somewhere on installing a patch onto Drupal 7 for me? Your help would greatly be appreciated.
Comment #4
daveparrish commentedThis is probably a better question to ask in the forums or IRC. But since you asked, the patch is simple enough where you could apply it by hand pretty easily. A patch file describes which lines should be removed/added/changed. There are several articles you can find by doing a search for "reading a patch file" or something along those lines.
If you are using Git then you should be able to follow the instructions here to download the workflow module and apply the patch.
I hope that helps!
Comment #5
katannshaw commentedVery good. I'll keep note of the forums or IRC for future questions on patches. Thanks again for your help!
Comment #6
thorsten. commentedHi Jay,
were you able to fix the problem? I have exactly the same error!
Comment #7
katannshaw commentedHi thorsten,
I uninstalled the Workflow module and went away from it for awhile. Then I recently downloaded the newest version of it, and re-tried adding to a content type with success this time. I'm not sure what happened, but they must have applied the patch to the module.
7.x-1.0 is the newest version of Workflow. What version of it are you using? And what is your setup?
Comment #8
nancydruAccording to #7, this is fixed.