mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-03 15:27:42 +02:00
[ticket/9831] Fix saving unchecked checkbox field value
PHPBB3-9831
This commit is contained in:
@@ -511,6 +511,14 @@ class acp_profile
|
|||||||
// If we switch the type on step 2, we have to adjust field value.
|
// If we switch the type on step 2, we have to adjust field value.
|
||||||
// 1 is a common value for the checkbox and radio buttons.
|
// 1 is a common value for the checkbox and radio buttons.
|
||||||
|
|
||||||
|
// Adjust unchecked checkbox value.
|
||||||
|
// If we return or save settings from 2nd/3rd page
|
||||||
|
// and the checkbox is unchecked, set the value to 0.
|
||||||
|
if (isset($_REQUEST['step']) && !isset($_REQUEST[$key]))
|
||||||
|
{
|
||||||
|
$var = 0;
|
||||||
|
}
|
||||||
|
|
||||||
// If we switch to the checkbox type but former radio buttons value was 2,
|
// If we switch to the checkbox type but former radio buttons value was 2,
|
||||||
// which is not the case for the checkbox, set it to 0 (unchecked).
|
// which is not the case for the checkbox, set it to 0 (unchecked).
|
||||||
if ($cp->vars['field_length'] == 2 && $var == 2)
|
if ($cp->vars['field_length'] == 2 && $var == 2)
|
||||||
|
Reference in New Issue
Block a user