From b2e4099a4ead9d598ad7782aebcfe18a8e19be95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cshraddha?= <“shraddha_s@techjoomla.com”> Date: Mon, 25 Nov 2019 18:45:59 +0530 Subject: [PATCH 1/2] Task #153576 --- .../com_tjucm/site/controllers/itemform.json.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/components/com_tjucm/site/controllers/itemform.json.php b/src/components/com_tjucm/site/controllers/itemform.json.php index 43a6c7eb..1b1fe67a 100644 --- a/src/components/com_tjucm/site/controllers/itemform.json.php +++ b/src/components/com_tjucm/site/controllers/itemform.json.php @@ -234,6 +234,7 @@ public function saveFormData() $formData = array_merge_recursive($formData, $filesData); $section = $post->get('tjUcmFormSection', '', 'STRING'); $draft = $post->get('draft', 0, 'INT'); + $state = $formData['state']; if (empty($formData) || empty($client)) { @@ -298,6 +299,14 @@ public function saveFormData() // Disable the draft mode of the item if full f)orm is submitted $table->draft = $draft; + + if ($state == null) + { + // For the first time saving get the record from table which already stored + $state = $table->state; + } + + $table->state = $state; $table->modified_date = Factory::getDate()->toSql(); $table->store(); From 6b9235931121c3e3c418f8b8a3b11f7ce74fa058 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cshraddha?= <“shraddha_s@techjoomla.com”> Date: Wed, 4 Dec 2019 17:21:10 +0530 Subject: [PATCH 2/2] Code improvement --- src/components/com_tjucm/administrator/controllers/types.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/com_tjucm/administrator/controllers/types.php b/src/components/com_tjucm/administrator/controllers/types.php index 8fb4ed69..bea26cdb 100644 --- a/src/components/com_tjucm/administrator/controllers/types.php +++ b/src/components/com_tjucm/administrator/controllers/types.php @@ -216,7 +216,7 @@ public function import() Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); JLoader::import('components.com_tjucm.tables.type', JPATH_ADMINISTRATOR); - JModelLegacy::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_tjfields/models'); + JModelLegacy::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_tjfields/models', 'TjfieldsModel'); JModelLegacy::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_tjucm/models'); $app = Factory::getApplication();