You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Filtering default doc settings via the filter bp_docs_get_default_access_options works as expected when the doc is not group-related. However, if you choose to associate the new doc with a group, the filter isn't effective. I believe the issue is the first line in bp_docs_access_options_helper() where the type is set to raw when a group_id is passed. https://github.com/boonebgorges/buddypress-docs/blob/master/includes/templatetags.php#L1160
I wonder if that check shouldn't be "set type to raw when a doc_id is passed"? Maybe "raw" should never be used here? Or maybe there is a reason that the group_id would matter here. I'm not sure. :)
For reference, here's where the 'raw' call for groups was introduced d58c868 It's not clear to me why I went this route, either from the changeset or from the associated issue #414.
The main purpose of 'raw', if I'm understanding bp_docs_get_doc_settings() correctly, is to prevent the saved settings from being parsed with the defaults. But I'm not sure why you'd ever want to do that, since it would leave empty values.
@dcavins If you want to experiment with removing the 'raw' call, please feel free. Based on #414, you'd want to check whether the default settings are working properly with private/hidden groups, to avoid a regression.
Filtering default doc settings via the filter
bp_docs_get_default_access_options
works as expected when the doc is not group-related. However, if you choose to associate the new doc with a group, the filter isn't effective. I believe the issue is the first line inbp_docs_access_options_helper()
where thetype
is set toraw
when agroup_id
is passed.https://github.com/boonebgorges/buddypress-docs/blob/master/includes/templatetags.php#L1160
I wonder if that check shouldn't be "set type to raw when a doc_id is passed"? Maybe "raw" should never be used here? Or maybe there is a reason that the group_id would matter here. I'm not sure. :)
This issue was pointed out here:
https://wordpress.org/support/topic/how-do-i-set-the-default-permissions-for-a-group-doc/
The text was updated successfully, but these errors were encountered: