Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed #120: New member state is pending, should be active when added by admin #124

Merged
merged 1 commit into from Jan 28, 2017

Conversation

alex-bukach
Copy link

No description provided.

@jcnventura
Copy link

Agree, admin should be able to promote to active directly.

Copy link

@mmcintosh mmcintosh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

found this via the drupal issue queue. Just wanted to take a look and perhaps test as I have this problem on a site.

https://www.drupal.org/node/2744405

Copy link

@mmcintosh mmcintosh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this code on OG 7.2.9 where I had the same issue as described in this issue:

https://www.drupal.org/node/2744405

I found the cope work as expected and now an administrator can add a user to a group and have it be active instead of pending. This was the behavior that was previously in place.

@amitaibu
Copy link
Member

Seems there's a patch in https://www.drupal.org/node/2744405, so closing to prevent duplication.

@amitaibu amitaibu closed this Oct 17, 2016
@alex-bukach
Copy link
Author

alex-bukach commented Oct 17, 2016

The patch posted there on d.o 3 days ago is the exactly the same I posted in this pull request in May? Why shouldn't it be committed?

@alex-bukach
Copy link
Author

If "Development and issues are handled on GitHub" (as mentioned at https://www.drupal.org/project/og), why to close the pull request on Githuub in favour of the d.o issue?

@amitaibu amitaibu reopened this Oct 17, 2016
@amitaibu
Copy link
Member

Sorry, the reason was that currently there's the #133 which is blocking. you are right, I'll close the d.o. one.

The reason it's not committed is - https://www.drupal.org/node/2744405#comment-11735053

@geek-merlin
Copy link

The reason it's not committed is - https://www.drupal.org/node/2744405#comment-11735053

So the test failed, saying:

fail: [Other] Line 461 of sites/all/modules/og/og_access/og_access.test:
User membership is pending.

I did not go deeper into this, but it looks like the test must be changed too.
(maybe discerning admin role.)

@geek-merlin
Copy link

CI sais:

The command "pear channel-discover pear.drush.org" failed and exited with 1 during .

That's not a problem of the patch...

@amitaibu amitaibu merged commit 4edaed4 into Gizra:7.x-2.x Jan 28, 2017
@amitaibu
Copy link
Member

Thanks!

@jackaponte
Copy link

jackaponte commented Jul 13, 2018

I don't see this commit in og 7.x-2.10 on drupal.org. Has it been fixed elsewhere now or was it just omitted?

I ran into the same question myself today while applying updates. This diff of the og-7.x-2.9 file in question against the 7.x-2.10 version seems to indicate that this commit/patch is no longer needed because the code affected by the patch is completely gone:

diff --git b/sites/all/modules/og/plugins/entityreference/behavior/OgBehaviorHandler.class.php a/sites/all/modules/og/plugins/entityreference/behavior/OgBehaviorHandler.class.php
index dc7373f7..d17a8e26 100644
--- b/sites/all/modules/og/plugins/entityreference/behavior/OgBehaviorHandler.class.php
+++ a/sites/all/modules/og/plugins/entityreference/behavior/OgBehaviorHandler.class.php
@@ -122,11 +122,7 @@ class OgBehaviorHandler extends EntityReference_BehaviorHandler_Abstract {
     foreach ($items as $item) {
       $gid = $item['target_id'];
 
-      // Must provide correct state in the event that approval is required.
-      if (empty($item['state']) && $entity_type == 'user' && !og_user_access($group_type, $gid, 'subscribe without approval', $entity) && !og_user_access($group_type, $gid, 'administer group')) {
-        $item['state'] = OG_STATE_PENDING;
-      }
-      elseif (empty($item['state']) || !in_array($gid, $diff['insert'])) {
+      if (empty($item['state']) || !in_array($gid, $diff['insert'])) {
         // State isn't provided, or not an "insert" operation.
         continue;
       }

(cross-posting to https://www.drupal.org/node/2744405)

@ghost
Copy link

ghost commented Aug 1, 2018

@jackalope: I think you're right. It's been a month now and I'm seeing no problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants