This repository has been archived by the owner on Aug 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 132
Change the content privacy when the group privacy is changed. #13
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -287,31 +287,32 @@ function og_access_field_attach_form($entity_type, $entity, &$form, &$form_state | |||
if (!og_is_group_type($entity_type, $bundle)) { | |||
return; | |||
} | |||
$form['#submit'][] = 'og_access_determine_group_privacy_change'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove the whole function.
Looks good, lets add a test. Non-working code: /**
* Test
*/
function testAccessChangeBatchApi() {
$settings = array(
'type' => $this->group_content_type,
'uid' => $this->user1->uid,
);
// Create two group content.
$node1 = $this->drupalCreateNode($settings);
$values = array(
'entity_type' => 'node',
'entity' => $node1,
);
og_group('node', $this->group_node, $values);
$this->assertFalse(node_access('view', $node1, $this->user2));
$this->drupalLogin($this->user1);
// Change the access of the group via UI, in order for batch API to be
// invoked
$edit = array();
$this->drupalPost('node/' . $this->group_node->nid . '/edit', $edit, 'Submit');
$this->assertTrue(node_access('view', $node1, $this->user2));
} |
@HelenaEksler please push the tests, even if they still fail. |
amitaibu
changed the title
Change the content privacy when the group privacy is changed.
WIP: Change the content privacy when the group privacy is changed.
Dec 2, 2014
HelenaEksler
changed the title
WIP: Change the content privacy when the group privacy is changed.
Change the content privacy when the group privacy is changed.
Dec 9, 2014
$this->assertFalse(node_access('view', $this->group_node, $this->user2), 'Other user should not see the group'); | ||
|
||
// Group is private. We are changing it to public. | ||
debug('Group is private. We are changing it to public.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove debug()
(here and below).
Merged, thanks. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#12