[buddypress-trac] [BuddyPress] #3279: Activity reply buttons have duplicate IDs
buddypress-trac at lists.automattic.com
buddypress-trac at lists.automattic.com
Sun Jun 12 13:16:22 UTC 2011
#3279: Activity reply buttons have duplicate IDs
--------------------------+-----------------------------
Reporter: boonebgorges | Owner:
Type: defect | Status: new
Priority: minor | Milestone: Awaiting Review
Component: Activity | Version: 1.2.8
Keywords: needs-patch |
--------------------------+-----------------------------
See some discussion on #3253
'Reply' buttons on activity items belonging to the same root activity item
have the same ID, 'acomment-reply-x' (where x is the activity id).
Duplicate IDs make for invalid markup.
This problem does not have an easy fix, because the button ID is used by
the javascript to determine which root activity should be set as the
item_id of the newly created activity item. See around line 305-308, line
327, and lines 344-350 of bp-default/_inc/global.js
A couple different strategies to fix:
- Add an additional hidden input field to the activity reply markup that
contains the ID the root activity item, and modify the JS to use that that
value
- In the JS, get the root activity ID by crawling up the tree using jQuery
.parents() or .find() or something like that. (I did a preliminary test of
this and it seemed to be quite slow, so ymmv.)
- Change the button ID so that it contains the root activity ID *in
addition to* the replied-to activity ID. Thus something like acomment-
reply-x-y, where x is the root activity id, and y is the immediate parent
id. Then modify the JS to parse this correctly.
IMO this is not urgent because it has always been this way, and it's not
affecting the way the page works. Any takers?
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/3279>
BuddyPress <http://buddypress.org/>
BuddyPress
More information about the buddypress-trac
mailing list