diff --git a/phpBB/phpbb/profilefields/type/type_int.php b/phpBB/phpbb/profilefields/type/type_int.php index b89faca018..267f522d5d 100644 --- a/phpBB/phpbb/profilefields/type/type_int.php +++ b/phpBB/phpbb/profilefields/type/type_int.php @@ -141,7 +141,7 @@ class type_int extends type_base */ public function get_profile_value($field_value, $field_data) { - if ($field_value === '' && !$field_data['field_show_novalue']) + if (($field_value === '' || $field_value === null) && !$field_data['field_show_novalue']) { return null; } diff --git a/tests/profile/get_profile_value_test.php b/tests/profile/get_profile_value_test.php new file mode 100644 index 0000000000..e867455a03 --- /dev/null +++ b/tests/profile/get_profile_value_test.php @@ -0,0 +1,42 @@ +getMock('\phpbb\request\request'), + $this->getMock('\phpbb\template\template'), + $this->getMock('\phpbb\user') + ); + + $this->assertSame($expected, $cp->get_profile_value($value, array( + 'field_type' => $type, + 'field_show_novalue' => $show_novalue, + ))); + } +}