I added a checkbox to the profile_fields array in profile.module:

    "programmer"     => array("checkbox", t("Are you a programmer?"), "", "", ""),

It displayed, but users.data wasn't updated properly when a user checked the box. _profile_form() was treating all form controls the same, but form_checkbox needs special handling. The attached patch fixes this.

Thanks to Tom Wood for the analysis and an earlier version of the patch.

-- Roger

CommentFileSizeAuthor
profile_checkbox.patch766 bytessskennel

Comments

morbus iff’s picture

dries’s picture

I could reproduce this problem and your patch seems to address it but when I tried the 'programmer'-example, the output on the user page wasn't exactly nice. It said '1'. I'm left wondering whether checkboxes are supposed to work at all in Drupal 4.4.x. (They work in HEAD.)

dries’s picture

dries’s picture