If you define fields in a category that contains a ampersand in its name, like "Name & Company", the fields will not show up the page when the user try to edit their profile (after the registration), by selecting the category name under /user.

The problem is in the profile_form_profile() function. It is receiving the $category attribute htmlescaped so the database query lo load the fields is:

SELECT * FROM profile_fields WHERE visibility != 4 AND LOWER(category) = LOWER('Name & Company') ORDER BY weight

Sorry for not giving a patch for the issue. But I've been trying to find out the problem for 2 hours with no results. I hope the above information will be useful in any case. (The problem could be in user.module... but I'm not sure).

Regards,
FredCK

CommentFileSizeAuthor
#1 html_entity_decode.patch456 byteschx

Comments

chx’s picture

Status: Active » Needs review
StatusFileSize
new456 bytes

The patch fixes the problem but whether it's the correct one or not, I can't tell. This is Steven's expertise.

chx’s picture

Version: 4.7.3 » x.y.z

This patch is for HEAD.

Steven’s picture

Status: Needs review » Fixed

a) html_entity_decode() should never be used. Use unicode.inc's decode_entities() instead.
b) profile categories are only ever used in a URL and in menu item titles. They should not be check_plain()'d in profile.module, that way no decoding needs to happen, and the url does not contain an unnecessary "amp;"

Fixed in HEAD.

chx’s picture

Version: x.y.z » 4.7.3
Status: Fixed » Reviewed & tested by the community

Gerhard, please commit to 4.7 whatever Steven committed :)

chx’s picture

Status: Reviewed & tested by the community » Fixed

Nope, I see now it's in 4.7 also. Awesome.

Anonymous’s picture

Status: Fixed » Closed (fixed)