PMCORE-4256 A field that uses SQL in a dynaform does not allow routing the case

This commit is contained in:
Julio Cesar Laura Avendaño
2023-07-14 14:27:54 +00:00
parent 894775408d
commit ef18c784b5

View File

@@ -364,7 +364,7 @@ class Form extends XmlForm
} }
//We do the query to the external connection and we've got the label //We do the query to the external connection and we've got the label
$con = Propel::getConnection(($this->fields[$k]->sqlConnection != "") ? $this->fields[$k]->sqlConnection : "workflow"); $con = Propel::getConnection(!empty($this->fields[$k]->sqlConnection) ? $this->fields[$k]->sqlConnection : "workflow");
$stmt = $con->prepareStatement($query); $stmt = $con->prepareStatement($query);
$rs = $stmt->executeQuery(ResultSet::FETCHMODE_NUM); $rs = $stmt->executeQuery(ResultSet::FETCHMODE_NUM);
@@ -402,7 +402,7 @@ class Form extends XmlForm
if ($query != '') { if ($query != '') {
// execute just if a query was set, it should be not empty // execute just if a query was set, it should be not empty
//we do the query to the external connection and we've got the label //we do the query to the external connection and we've got the label
$con = Propel::getConnection( $this->fields[$k]->sqlConnection != "" ? $this->fields[$k]->sqlConnection : "workflow" ); //use default connection workflow if connection is not defined. Same as Dynaforms $con = Propel::getConnection( !empty($this->fields[$k]->sqlConnection) ? $this->fields[$k]->sqlConnection : "workflow" ); //use default connection workflow if connection is not defined. Same as Dynaforms
$stmt = $con->prepareStatement( $query ); $stmt = $con->prepareStatement( $query );
@@ -442,7 +442,7 @@ class Form extends XmlForm
} }
//we do the query to the external connection and we've got the label //we do the query to the external connection and we've got the label
$con = Propel::getConnection( $this->fields[$k]->sqlConnection != "" ? $this->fields[$k]->sqlConnection : "workflow" ); $con = Propel::getConnection( !empty($this->fields[$k]->sqlConnection) ? $this->fields[$k]->sqlConnection : "workflow" );
$stmt = $con->prepareStatement( $query ); $stmt = $con->prepareStatement( $query );
$rs = $stmt->executeQuery( ResultSet::FETCHMODE_NUM ); $rs = $stmt->executeQuery( ResultSet::FETCHMODE_NUM );
while ($rs->next()) { while ($rs->next()) {