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 | Owned by: | 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.
This seems good to me.