From 6eee93dce47455083da0427960f52a258f49fb2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CShivani=E2=80=9D?= <“shivani_p@tekditechjoomla.com”> Date: Mon, 24 Feb 2020 17:55:07 +0530 Subject: [PATCH] Bug #157854: If user is adding new T&C for same page with same T&C code & version, message 'Item saved successfully' displayed but T&C not get added in the list --- src/components/com_tc/administrator/controllers/content.php | 2 +- .../com_tc/administrator/views/content/tmpl/edit.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/com_tc/administrator/controllers/content.php b/src/components/com_tc/administrator/controllers/content.php index 5512ccd..2e529df 100755 --- a/src/components/com_tc/administrator/controllers/content.php +++ b/src/components/com_tc/administrator/controllers/content.php @@ -52,7 +52,7 @@ public function checkDuplicateAndLatestVersionTC() if ($getMaxTCVersion == 'newVersion') { // If T&C is first new version[new TC] - echo 1; + echo 0; } else { diff --git a/src/components/com_tc/administrator/views/content/tmpl/edit.php b/src/components/com_tc/administrator/views/content/tmpl/edit.php index 05da6f9..610b8ba 100755 --- a/src/components/com_tc/administrator/views/content/tmpl/edit.php +++ b/src/components/com_tc/administrator/views/content/tmpl/edit.php @@ -107,12 +107,12 @@ function(response) { } ).done( function(data) { - if (data == 1) { + if (data === 0) { // this T&C has first version valid = true; } else if (tcVersion <= data) { - alert(''+ tcClient +' - '+ data + + alert(''+ tcClient +' - '+ data + ''); jQuery('#jform_version').val('');