When we configure the redirect plugin to append the jump url with the form data, checkboxes with only one subElement checked do not get appended to the jump url if that subElement is other than the first one.
The reason for this is as follows:
The form returns an array of subElements that are checked, indexed by the subElement number (0 to however many are configured). If we have 3 subElements, these would be 0, 1 & 2.
If only one element is checked, for example subElement 1, the form data array would be [1=>{value of the subElement}]
In plugins/fabrik_form/redirect/redirect.php function _appendQS processes the form data and it converts a single element array into a simple value. However, it assumes the index value of the single element is zero. When this happens there is nothing in index value zero so an empty checkbox selection is sent.
The problem code is at line 335 of this file which currently has
To correct this problem change this line to:
The reason for this is as follows:
The form returns an array of subElements that are checked, indexed by the subElement number (0 to however many are configured). If we have 3 subElements, these would be 0, 1 & 2.
If only one element is checked, for example subElement 1, the form data array would be [1=>{value of the subElement}]
In plugins/fabrik_form/redirect/redirect.php function _appendQS processes the form data and it converts a single element array into a simple value. However, it assumes the index value of the single element is zero. When this happens there is nothing in index value zero so an empty checkbox selection is sent.
The problem code is at line 335 of this file which currently has
Code:
this->_appendQS($queryvars, $key, $val[0], $appendEmpty);
Code:
this->_appendQS($queryvars, $key, array_pop($val), $appendEmpty);