it is possible to have an empty field in the profile_value table that is marked as mandatory for PCP but not for drupal core. These fields will have a record, so according to the following line (197) they are counted:

$query = db_query("SELECT * FROM {profile_values} WHERE uid = %d", $uid);

If that line is changed to

$query = db_query("SELECT * FROM {profile_values} WHERE value != '' AND uid = %d", $uid);

They are not any more.

(one way of creating such a field, is to create a select-list field, with an empty line as the first option. In the GUI this will show as "--" and it will save an empty value in the value column.

The benefit of having this configuration instead of one where the field is mandatory for Core, is that when the field is mandatory in Core, the -- are removed, and the first option is selected by default. This results in a lot of users accident selecting that first option. )

Comments

batje’s picture

Status: Active » Closed (fixed)

this behavious seems to a bit inconsistent.

First of all, in the same installation, empty fields (where you select -- in the select box) are now stored as "0".

Secondly, when adding an empty line to the Selection options: of the Profile field, saving, and then re-opening the Profile Field edit form, makes the empty line disappear.

Let's close this for now.