Creating a new book page with Outline designer in the context of a group correctly sets the audience to this group.
However, the "public" checkbox is set by default.

CommentFileSizeAuthor
#2 modules.pdf311.72 KBjvieille

Comments

btopro’s picture

hmm.. any related modules your using just so I know if I can test this in my current environment correctly?

I'm running Spaces, OG, Spaces_OG, PURL, and used to have OG default on but dropped it. Creating a couple thousand nodes for testing off and on and haven't noticed this issue but could just be oversight on my part (accounting for this "feature" downstream ;))

Let me know and I'll take a look.

jvieille’s picture

StatusFileSize
new311.72 KB

Thank you for taking care.
Attached the list of activated modules for this site
I use OG Defaults

btopro’s picture

Looking into this because it seems to be incorrect when marking things public... wondering if the logic is backwards, Looking into this some tomorrow but this seems to be where it might be:

function outline_designer_og_new_book_object_alter(&$node) {
  // Load the group node.
  $group_node = node_load(db_result(db_query("SELECT group_nid
                                    FROM {og_ancestry}
                                    WHERE nid = %d", $node->book['bid'])));
  $is_public = TRUE;
  if ($group_node->og_private) {
    $is_public = FALSE;
  }
  $node->og_public = $is_public;
  $node->og_groups[$group_node->nid] = $group_node->nid;
}
btopro’s picture

Version: 6.x-1.3 » 6.x-1.x-dev
Status: Active » Needs review

it would appear to be setting this correctly in my setup. public book roots are kept public. Did you try rebuilding node permissions? it could be that you've created a book root that's public in a private group (or a group you ment to keep private at least). This also could be an issue where content was later moved into a group.. not sure but I'm unable to replicate this in my distro

jvieille’s picture

I tried again, making sure the root book is private, rebuild permissions, clear caches.... but new content is always public.

btopro’s picture

Hmm... admittedly I'm only using this project with Spaces as it bundles permission management like that a bit better. Have you tried using that to solve this?

jvieille’s picture

I am happy with OG permissions at this point, and I have never tried Spaces, I don't seem to need it at this point.

By the way, I am wondering if
if ($group_node->og_private) {

is correct with PHP 5.3?

btopro’s picture

All I run is 5.3, haven't had any problems with this code / module.

foredoc’s picture

same problem here. any updates?

jvieille’s picture

Not solved for me

btopro’s picture

i haven't seen this NOT working and I've been running this module in an OG stack developing elms for the better part of 8 months now.

foredoc’s picture

@btopro: did you test it without spaces module enabled?
Thanks

btopro’s picture

i didn't write the integration and it has never been used outside of a spaces based environment to my knowledge so I can't speak to it. It was originally written for EduGlu and now runs in ELMS. Both are spaces based so that was the target, that code that's setting the flag doesn't call anything with spaces so unless spaces changes the connotation of how things are public I'm not sure why this would be an issue.

Will accept patches for this.

foredoc’s picture

Thanks, will take a look into it

foredoc’s picture

seems to me that the logic in following function does not work without space_og module.

/**
 * Implementation of hook_new_book_alter().
 */
function outline_designer_og_new_book_object_alter(&$node) {
  // Load the group node.
  $group_node = node_load(db_result(db_query("SELECT group_nid
                                    FROM {og_ancestry}
                                    WHERE nid = %d", $node->book['bid'])));
  $is_public = TRUE;
  if ($group_node->og_private) {
    $is_public = FALSE;
  }
  $node->og_public = $is_public;
  $node->og_groups[$group_node->nid] = $group_node->nid;
}

With space_og,
if a group is private, then all its posts are private;
if a group is non-private(public), then all its posts are public

Without space_og, the logic is totally different:
if a group is private, the posts in it could either be private or public
if a group is non-private, the posts in it could either be private or public

Basically, for the og module, the status of its post(public/private) depends on :
1) og_selective attribute of the group;
2) author's decision on the post.

Following are some thoughts:
1) All book pages should have the same status, either public or non-public.
2) Only show the "public" checkbox on book root node's edit page, hide the checkbox for all child pages.
3) When adding a child page, the status should be inherited from the book root node
4) When changing the status of a book root node, the status of all its child pages should also be changed.

jvieille’s picture

I don't think that all book pages private flag should be synced.
The book pages should follow the same logic that any node, i.e. have the default status from the group settings that the author can change when creating / editing the node.
Of course, there are some situations where the proposed behavior would be neat, it would be a "nice to have" optional feature.

this module should definitely made plain OG consistent, Spaces is a quite "exotic" module - the vast majority of OG implementations do not mix up with Spaces - it should not be made mandatory here.

btopro’s picture

Category: bug » feature
Status: Needs review » Needs work

Tend to agree with a lack of sync. If you WANT a sync (imo) then that's where you really want Spaces because you are using / wanting logic that says "whatever my group currently is, all content behaves this way" which is basically Spaces OG Logic. I also agree on not requiring spaces / spaces og and had no plans to do so but I also think if you want this syncing then that's something that Spaces helps account for.

foredoc’s picture

@btopro: are u using spaces with open arium ?

btopro’s picture

i think the people that made open atrium made spaces for it. I use spaces with the ELMS distribution which is what this module was primarily written for.