{"action":"created","issue":{"url":"https://api.github.com/repos/boonebgorges/buddypress-docs/issues/532","repository_url":"https://api.github.com/repos/boonebgorges/buddypress-docs","labels_url":"https://api.github.com/repos/boonebgorges/buddypress-docs/issues/532/labels{/name}","comments_url":"https://api.github.com/repos/boonebgorges/buddypress-docs/issues/532/comments","events_url":"https://api.github.com/repos/boonebgorges/buddypress-docs/issues/532/events","html_url":"https://github.com/boonebgorges/buddypress-docs/issues/532","id":142484041,"number":532,"title":"Don't create group activity stream items when doc read settings are restrictive.","user":{"login":"dcavins","id":1391994,"avatar_url":"https://avatars.githubusercontent.com/u/1391994?v=3","gravatar_id":"","url":"https://api.github.com/users/dcavins","html_url":"https://github.com/dcavins","followers_url":"https://api.github.com/users/dcavins/followers","following_url":"https://api.github.com/users/dcavins/following{/other_user}","gists_url":"https://api.github.com/users/dcavins/gists{/gist_id}","starred_url":"https://api.github.com/users/dcavins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcavins/subscriptions","organizations_url":"https://api.github.com/users/dcavins/orgs","repos_url":"https://api.github.com/users/dcavins/repos","events_url":"https://api.github.com/users/dcavins/events{/privacy}","received_events_url":"https://api.github.com/users/dcavins/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2016-03-21T22:02:30Z","updated_at":"2016-03-30T22:37:47Z","closed_at":null,"body":"If a doc is associated with a group but only readable by group mods or admins or the creator (which is in itself weird, but done) we shouldn't create an activity item because it's a tease that results in 404s.\r\n\r\nHere's one approach: https://github.com/dcavins/buddypress-docs/commit/9905ced0175fc51f4a6ef9c86411f25d894370fa\r\n\r\nI have reservations about this because it moves the `bp_docs_activity_args` filter to fire before the `bp_docs_before_activity_save` action, would could be surprising, because the group info is added at `bp_docs_activity_args`. Also, destroying the activity args to halt the process is effective, but could cause problems with filters that come later (and expect `$args['secondary_item_id']` to exist).\r\n\r\nAnother thought was to add a boolean filter `bp_docs_allow_activity_item_creation` before `bp_docs_before_activity_save`, but this would still require the activity args filter to be moved up in the chain. And it adds another filter. But maybe another filter that does what it says is more straightforward:\r\nhttps://github.com/dcavins/buddypress-docs/commit/64a0c9d3d9778fc712b66ae5224241f9d4a16fd6\r\n\r\nComment activity is directly hot-wired, already: https://github.com/boonebgorges/buddypress-docs/blob/master/includes/activity.php#L43\r\nSo we could also go that route. (Or the comment code could use the new `bp_docs_allow_activity_item_creation` filter if we go that way. )"},"comment":{"url":"https://api.github.com/repos/boonebgorges/buddypress-docs/issues/comments/203669872","html_url":"https://github.com/boonebgorges/buddypress-docs/issues/532#issuecomment-203669872","issue_url":"https://api.github.com/repos/boonebgorges/buddypress-docs/issues/532","id":203669872,"user":{"login":"dcavins","id":1391994,"avatar_url":"https://avatars.githubusercontent.com/u/1391994?v=3","gravatar_id":"","url":"https://api.github.com/users/dcavins","html_url":"https://github.com/dcavins","followers_url":"https://api.github.com/users/dcavins/followers","following_url":"https://api.github.com/users/dcavins/following{/other_user}","gists_url":"https://api.github.com/users/dcavins/gists{/gist_id}","starred_url":"https://api.github.com/users/dcavins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcavins/subscriptions","organizations_url":"https://api.github.com/users/dcavins/orgs","repos_url":"https://api.github.com/users/dcavins/repos","events_url":"https://api.github.com/users/dcavins/events{/privacy}","received_events_url":"https://api.github.com/users/dcavins/received_events","type":"User","site_admin":false},"created_at":"2016-03-30T22:37:47Z","updated_at":"2016-03-30T22:37:47Z","body":"I think this is the source of the problem:\r\nhttps://github.com/dcavins/buddypress-docs/commit/a2cea134ef17890e1946312ea5076ea27caa0bec"}}