[buddypress-trac] [BuddyPress Trac] #5806: Issue adding members to team who have a whitespace in their names
buddypress-trac
noreply at wordpress.org
Mon Aug 11 12:45:41 UTC 2014
#5806: Issue adding members to team who have a whitespace in their names
--------------------------+-----------------------------
Reporter: peter.eussen | Owner:
Type: defect (bug) | Status: new
Priority: low | Milestone: Awaiting Review
Component: Groups | Version: 2.0
Severity: minor | Keywords: has-patch
--------------------------+-----------------------------
Recently i encountered a problem with the "add new members" functionality
in the admin section. When i tried adding a member who had a space (and
dot) in their name, it refused to add them.
The problem arises because the javascript in question (buddypress/bp-
groups/admin/js/admin.js) tries to create a remove element where the ID of
the element is based on the name.
To reproduce it:
- create a user who has a dot in his name say (Peter v. Eussen)
- Try to add the user to a team
You should see it show up in the list of users to add, but not in the list
of added users after you update the group.
Solution would be simple:
In bp-groups/admin/js/admin.js replace line 3 with the following line:
{{{
var remove_id = 'bp-groups-remove-new-member-' +
ui.item.value.replace(/[,:\.\s\-]/g,'-');
}}}
Maybe more characters need to be added to ensure that the value complies
to valid HTML ID characters.
I wonder though.. why is the displayed name used in the new_members[]
array, instead of say the "login name", which would seem more unique..
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5806>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list