BUG 6987 Error en PM al guardar formulario [FIXED]

When dropdown is with savelabel active then on form save the sql(s) need to be executed. By default any sqlconnection is defined as an empty string and Pm uses the default connection workflow.. the issue was that in savelabel stage this default option was not defined then tried to connect to an empty connection.
This commit is contained in:
Hugo Loza
2011-06-01 18:37:18 -04:00
parent 6bd4950bd8
commit 7454de6ee1

View File

@@ -321,7 +321,7 @@ class Form extends XmlForm
} else {
$query = G::replaceDataField($this->fields[$k]->sql,$newValues);
//we do the query to the external connection and we've got the label
$con = Propel::getConnection($this->fields[$k]->sqlConnection);
$con = Propel::getConnection($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);
$rs = $stmt->executeQuery(ResultSet::FETCHMODE_NUM);