Skip to content

Commit

Permalink
Contact form loses data after postback with error (#17743)
Browse files Browse the repository at this point in the history
* 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))
  • Loading branch information
sandewt authored and Michael Babker committed Jan 8, 2018
1 parent f3db025 commit 67e95cb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion components/com_contact/views/contact/view.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down

0 comments on commit 67e95cb

Please sign in to comment.