Opened 10 years ago
Closed 10 years ago
#6141 closed defect (bug) (fixed)
Post types activities are not set when using Ajax
Reported by: | imath | Owned by: | boonebgorges |
---|---|---|---|
Milestone: | 2.2 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Activity | Keywords: | has-patch commit |
Cc: |
Description
To reproduce, put the following code in a bp-custom.php file :
add_post_type_support( 'page', 'buddypress-activity' );
Post a page, then find the corresponding activity in the database and remove the content or edit the action field.
Go to the activity directory, you should see "username wrote a new item" whatever you edited in the db action field.
If you filter the stream to list Pages, you'll have the content you edited (or nothing if you removed the action string) in the db action field.
Since activity action strings are generated at run time, the format callback should always be available even when doing Ajax.
So i suggest the attached patch to solve the issue.
Thanks, imath. 6141.patch seems pretty arbitrary. Since this problem has now come up twice (#6126), we should try to get to the bottom of it in a less arbitrary way.
See [6141.2.patch]. By using bp_activity_get_actions() here instead of touching the global directly, we ensure that every action type gets registered. If this works, we can roll back [9366].