Merged in dheeyi/processmaker/PM-1150 (pull request #2183)

PM-1150 El trigger PMF Delete Case despliega el error Fatal error: Call to a member function toArray() on a non-object in /opt/processmaker280/workflow/engine/classes/class.case.php on line 949
This commit is contained in:
Julio Cesar Laura Avendaño
2015-05-18 12:15:06 -04:00
2 changed files with 77 additions and 66 deletions

View File

@@ -949,6 +949,10 @@ class Cases
public function updateCase($sAppUid, $Fields = array())
{
try {
$oApplication = new Application;
if (!$oApplication->exists($sAppUid)) {
return false;
}
$aApplicationFields = $Fields['APP_DATA'];
$Fields['APP_UID'] = $sAppUid;
$Fields['APP_UPDATE_DATE'] = 'now';

View File

@@ -56,6 +56,11 @@ class Application extends BaseApplication
*/
public function getAppTitle()
{
$oApplication = new Application;
if (!$oApplication->exists($this->getAppUid())) {
return false;
}
if ($this->getAppUid() == '') {
throw (new Exception( "Error in getAppTitle, the APP_UID can't be blank"));
}
@@ -311,7 +316,9 @@ class Application extends BaseApplication
try {
$oApplication = ApplicationPeer::retrieveByPk( $AppUid );
if (!$oApplication) {
return false;
}
if (is_object($oApplication) && get_class ($oApplication) == 'Application' ) {
$aFields = $oApplication->toArray(BasePeer::TYPE_FIELDNAME);
$this->fromArray($aFields, BasePeer::TYPE_FIELDNAME);