Skip to content

Commit

Permalink
Task techjoomla#284 fix: Cluster not getting update in UCM main record
Browse files Browse the repository at this point in the history
  • Loading branch information
pravinTek committed Dec 10, 2019
1 parent 24da538 commit bc4c38d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/components/com_tjucm/site/controllers/itemform.json.php
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,11 @@ public function saveFormData()
$formData['fieldsvalue'] = $data;
$formData['client'] = $client;
$formData['created_by'] = $table->created_by;
$isNew = $table->draft;

// If data is valid then save the data into DB
$response = $model->saveFieldsData($formData);

$msg = null;

if ($response && empty($section))
Expand All @@ -296,7 +298,8 @@ public function saveFormData()
$msg = ($response) ? Text::_("COM_TJUCM_ITEM_SAVED_SUCCESSFULLY") : Text::_("COM_TJUCM_FORM_SAVE_FAILED");
}

// Disable the draft mode of the item if full f)orm is submitted
// Disable the draft mode of the item if full form is submitted
$table->load($recordId);
$table->draft = $draft;
$table->modified_date = Factory::getDate()->toSql();
$table->store();
Expand All @@ -307,7 +310,7 @@ public function saveFormData()
// TJ-ucm plugin trigger after save
$dispatcher = JEventDispatcher::getInstance();
PluginHelper::importPlugin("content");
$dispatcher->trigger('onUcmItemAfterSave', array($table->getProperties(), $data));
$dispatcher->trigger('onUcmItemAfterSave', array($table->getProperties(), $data, $isNew));
}
}

Expand Down

0 comments on commit bc4c38d

Please sign in to comment.