From 67e95cb54c0dd020f95a1b5a32ac27255f935d10 Mon Sep 17 00:00:00 2001 From: jsanders Date: Mon, 8 Jan 2018 18:18:41 +0100 Subject: [PATCH] Contact form loses data after postback with error (#17743) * Contact form loses data after postback with error Pull Request for issue #17126. Testing Instructions. See issue #17126 * Go to Single Contact. * Fill in the form. * Do not fill in captcha. * Send email. Expected result: Warning + textboxes are NOT empty. So the user should not entered all text again. Actual result: All textboxes are empty, so the user has to enter again all textboxes. Thanks to: @ pascal-910. * Delete some tabs Delete some tabs. * Update view.html.php if (!isset($item->catid) || empty($item->catid)) changes to if (empty($item->catid)) --- components/com_contact/views/contact/view.html.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/com_contact/views/contact/view.html.php b/components/com_contact/views/contact/view.html.php index 81e99d36bca30..53711853e1702 100644 --- a/components/com_contact/views/contact/view.html.php +++ b/components/com_contact/views/contact/view.html.php @@ -72,7 +72,10 @@ public function display($tpl = null) $item = $this->get('Item'); $state = $this->get('State'); - $app->setUserState('com_contact.contact.data', array('catid' => $item->catid)); + if (empty($item->catid)) + { + $app->setUserState('com_contact.contact.data', array('catid' => $item->catid)); + } $this->form = $this->get('Form');