Skip to:
Content

BuddyPress.org

Opened 11 years ago

Closed 11 years ago

#5364 closed defect (bug) (fixed)

Collapsible feature is not working in component single item administration screens

Reported by: imath's profile imath Owned by: imath's profile imath
Milestone: 2.0 Priority: low
Severity: normal Version: 1.9.1
Component: Administration Keywords: has-patch commit
Cc:

Description

Sarah (@pollyplummer) alerted me that the collapsible feature was not working on the new "Community Profile" administration screen. I remembered same behavior was happening in single Group Administration screen and in single Activity Administration screen.

I've dived a little in WordPress javascripts we are enqueueing to benefit from this feature. And i've found that the problem was linked to the script comment.js. We enqueue it in Groups single item, Activity single item and Community profile.

comment.js uses this function postboxes.add_postbox_toggles('comment'); and as a result the page argument of the save state function is "comment" instead of the right administration page id.

I think Groups single item and Community profile doesn't need this script, so we might simply avoid enqueueing it to make the collapsible feature work (+ user options saved).

Activity single item Administration screen needs it in order to change the date of the activity. Hopefully the admin.js of this component is loaded after comment.js so we can rerun the postboxes.add_postbox_toggles in favor of the right administration page id.

That's what i've attached in the patch. I've tested and it seems to solve the trouble : collapsible works and the states are saved.

Attachments (1)

5364.diff (6.7 KB) - added by imath 11 years ago.

Download all attachments as: .zip

Change History (6)

@imath
11 years ago

#1 @boonebgorges
11 years ago

This seems good to me.

#2 @hnla
11 years ago

Patched as well and it seems fine - however in checking it highlighted a few issues in missing icons for the toggle and for the sortable cursor in the activity single edit screens, looking further noticed that the requisite elements and classes were missing e.g <div class="handlediv" title="click to toggle"><br /></div> & the ui-sortable classes checked the admin file and realised that the aproach to mixing do_metabox & hardcoded meta box markup is fundamentally flawed so started trying to re-factor things so hardcoded markup was functioned and added to the register_metaboxes, got stuck on trying to get $activity->content pulling in to the wp_editor and then was called to other duities.

Members admin screens also lack the icons so suspect same issues exists for all these admin screens and a could do with a general overhaul.

Not the first time I've have enjoyed messing around with metabox markup - born in the fires of hell! :(

Version 1, edited 11 years ago by hnla (previous) (next) (diff)

This ticket was mentioned in IRC in #buddypress-dev by imathfromparis. View the logs.


11 years ago

#4 @johnjamesjacoby
11 years ago

  • Keywords commit added; 2nd-opinion removed

Works here. Have at it.

#5 @imath
11 years ago

  • Owner set to imath
  • Resolution set to fixed
  • Status changed from new to closed

In 8030:

Ensures metaboxes are collapsible in various Administration screens

When editing an activity, editing a group or editing a profile from the corresponding WordPress Administration screens, metaboxes are now fully collapsible.

Fixes #5364

Note: See TracTickets for help on using tickets.