User tests: Successful: Unsuccessful:
Related to
[bug] [33848] Fix fatal error when sending contact form (#3763)
How to test
@Kubik-Rubik i can confirm the issue and the fix
I'm thinking that we should just revert the actual check in the controller and fix it there. It's not necessary a given that any contact form uses JForm to create that checkbox.
HTML Checkboxes are a funny thing. The value of the checkbox actually doesn't matter at all. You have to check if they are submitted, not if they contain a value. The value is only relevant if you have multiple checkboxes with the same name.
On a sidenote, that's actually done wrong in 3.x as well...
I think that a value parameter should be used in a checkbox field and so we can use this solution to fix the bug!
Yes, we could also only optimize the if statement. Instead of checking !empty($data['contact_email_copy'])
we could just check whether this request variable is set at all isset($data['contact_email_copy'])
. If the checkbox is selected, then the request variable is set with an empty value. With the current check this can never be true without providing a value. In Joomla! 3.x the value is set to 1, so the initial fix does work there.
Just before I test, should I test the value 1 or the proposed controller change? Confused.
I would use isset
personally. Mainly because we don't really know where the form is coming from. It may well be an override (or even a module) which doesn't use JForm and thus would still be broken.
I don't want to risk another broken thing :)
The XML change can of course be kept as well. It's always better :)
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2014-06-23 13:58:49 |
JoomlaCode entry: http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=33860