From 345e8e084fd5ab7f99442ce6515a786a90806e2e Mon Sep 17 00:00:00 2001
From: rxu <rxu@mail.ru>
Date: Fri, 10 Feb 2012 00:31:13 +0800
Subject: [PATCH 1/2] [ticket/9084] Don't hide 'non-entered' dropdown CPF value
 if not required

PHPBB3-9084
---
 phpBB/includes/functions_profile_fields.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/phpBB/includes/functions_profile_fields.php b/phpBB/includes/functions_profile_fields.php
index 1eae2a9ad6..79701429e6 100644
--- a/phpBB/includes/functions_profile_fields.php
+++ b/phpBB/includes/functions_profile_fields.php
@@ -571,7 +571,7 @@ class custom_profile
 					$this->get_option_lang($field_id, $lang_id, FIELD_DROPDOWN, false);
 				}
 
-				if ($value == $ident_ary['data']['field_novalue'])
+				if ($value == $ident_ary['data']['field_novalue'] && $ident_ary['data']['field_required'])
 				{
 					return NULL;
 				}

From cd61de4bfdd1818d173e7413e53d8fd3d7ce1913 Mon Sep 17 00:00:00 2001
From: Oleg Pudeyev <oleg@bsdpower.com>
Date: Fri, 9 Mar 2012 04:31:03 -0500
Subject: [PATCH 2/2] [ticket/9084] Explain the logic.

PHPBB3-9084
---
 phpBB/includes/functions_profile_fields.php | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/phpBB/includes/functions_profile_fields.php b/phpBB/includes/functions_profile_fields.php
index 79701429e6..d44be16184 100644
--- a/phpBB/includes/functions_profile_fields.php
+++ b/phpBB/includes/functions_profile_fields.php
@@ -571,6 +571,11 @@ class custom_profile
 					$this->get_option_lang($field_id, $lang_id, FIELD_DROPDOWN, false);
 				}
 
+				// If a dropdown field is required, users
+				// cannot choose the "no value" option.
+				// They must choose one of the other options.
+				// Therefore, here we treat a value equal to
+				// the "no value" as a lack of value, i.e. NULL.
 				if ($value == $ident_ary['data']['field_novalue'] && $ident_ary['data']['field_required'])
 				{
 					return NULL;