From 3108d0b0608d12e8f1e2e10dfa8d802ad86eb908 Mon Sep 17 00:00:00 2001 From: Cesar G <prototech91@gmail.com> Date: Tue, 11 Nov 2014 16:28:06 -0800 Subject: [ticket/13209] Fix expected request value of CPF language fields. Multiple languages can be edited, thus the expected value is an array. PHPBB3-13209 --- phpBB/phpbb/profilefields/type/type_base.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/phpBB/phpbb/profilefields/type/type_base.php b/phpBB/phpbb/profilefields/type/type_base.php index 52f5d15511..9b4bada26d 100644 --- a/phpBB/phpbb/profilefields/type/type_base.php +++ b/phpBB/phpbb/profilefields/type/type_base.php @@ -158,7 +158,19 @@ abstract class type_base implements type_interface } else { - return $this->request->variable($key, '', true); + $default_value = ''; + $lang_fields = array( + 'l_lang_name', + 'l_lang_explain', + 'l_lang_default_value', + 'l_lang_options', + ); + + if (in_array($key, $lang_fields)) + { + $default_value = array(0 => ''); + } + return $this->request->variable($key, $default_value, true); } } -- cgit v1.2.1 From ec220d64946e9fc50df6645087a38c8852625af0 Mon Sep 17 00:00:00 2001 From: Cesar G <prototech91@gmail.com> Date: Tue, 11 Nov 2014 16:32:04 -0800 Subject: [ticket/13209] Gather language field values for boolean CPF's in all steps. The user can move back and forth between all three steps and as such the lang field data should be expected in all steps. PHPBB3-13209 --- phpBB/phpbb/profilefields/type/type_bool.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/phpbb/profilefields/type/type_bool.php b/phpBB/phpbb/profilefields/type/type_bool.php index 0582722833..75934e3be7 100644 --- a/phpBB/phpbb/profilefields/type/type_bool.php +++ b/phpBB/phpbb/profilefields/type/type_bool.php @@ -352,7 +352,7 @@ class type_bool extends type_base } } - if ($step == 3 && ($field_data[$key] || $action != 'edit') && $key == 'l_lang_options') + if ($key == 'l_lang_options' && $this->request->is_set($key)) { $field_data[$key] = $this->request->variable($key, array(0 => array('')), true); -- cgit v1.2.1