AOW_Workflow SQL Syntax error BUG

I have just upgraded 7.11.7 to 7.11.9 on a server running debian stretch, php 7.2 & 10.1.41-MariaDB

I find when I add actions to a workflow they disappear on save.

The log shows twice:

[INFO] Query:SELECT id FROM aow_actions WHERE aow_workflow_id = ’ ‘29167e0d-90ee-62dd-0b21-5dca228aff82’ ’ AND deleted = 0 ORDER BY action_order ASC
[DEBUG] Mysqli_query failed, error was: MySQL error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘29167e0d-90ee-62dd-0b21-5dca228aff82’’ AND deleted = 0 ORDER BY action_order ASC’ at line 1, query was:
[FATAL] Mysqli_query failed.

Note the nested single quotes around the aow_workflow_id (I have added the spaces between the single quotes for emphasis).

I noted that the aow_workflow_id does not have literal single quotes around aow_workflow_id in the database.

I also noted that in AOW_WorkFlow.php, what appears to be the relevant line at line 933 is:

$sql = “SELECT id FROM aow_actions WHERE aow_workflow_id = '”.$this->id."’ AND deleted = 0 ORDER BY action_order ASC";

and in AOW_Actions.php at line 78:

$sql = “SELECT id FROM aow_actions WHERE aow_workflow_id = '” . $idQuoted . “’ AND deleted = 0 ORDER BY action_order ASC”;

When the additional single quotes are removed in both these scripts, all behaves as expected.

However, while this means that the workflow can be edited and displayed, it won’t run unless I revert AOW_Actions.php back to the way it was, as it produces:

[FATAL] Query Failed: SELECT id FROM aow_actions WHERE aow_workflow_id = f0340115-fd72-a968-f51e-5cf71cb13140 AND deleted = 0 ORDER BY action_order ASC: MySQL error 1054: Unknown column ‘f0340115’ in ‘where clause’

because the workflow_id has NO single quotes.

So I can either display & edit workflow actions, or I can run them, but not both…

Suggestions gratefully accepted.

Fixed in 7.11.10