This would be critical, but I am probably doing something wrong.

There are no error messages for this anywhere. I've checked the PHP logs, server logs, drupal logs.

I have three members logged on from the same computer (three different browsers)

  • One member is the super user. In this test, the super user is the group manager of the two test groups.
  • A second member either attempts to subscribe or unsubscribe. After clicking the join or remove button, the user loses access to the entire site. Changing the url to the base address of the site does not help. A refresh does not help. Restarting the browser does not help. Clearing the cache (multiple times) does not help.
  • A third user that had been logged on has also lost access to the entire site.
  • The super user still is working. If the super user browses to the home page, usually that clears everything up for everybody. But sometimes the super user has to browse several pages. I have not figured out the pattern.

This site happens to be using https. I do not know if that matters. This is a strange one. I have refreshed OG with both 7.x-1.3 and 7.x-1.dev and have the problem on both. What I have not done is scratch everything and start over with fresh installs. I was hoping to avoid that.

Any suggestions of how to proceed? Without any messages, I'm flying blind.

CommentFileSizeAuthor
#2 call stack.png44.91 KBDavid4514

Comments

David4514’s picture

I finally moved the entire site to a platform with a PHP debugger. I could not find any thing. Drupal seemed to be running to completion without error.

So I started deactivating modules. I hit upon RealName (7.x-1.0-rc2). With that module disabled, the submit for join (subscribe) and remove (unsubscribe) works again. The odd thing is that no other forms with submit were having a problem. It seems to be something particular about Real Name and Organic Groups.

Any Ideas?

I have also opened an issue for the realname module at 1341868. I cannot determine if og is the issue or if the problem resides with realname.

David4514’s picture

Priority: Normal » Major
StatusFileSize
new44.91 KB

This is caused by a loop, though I do not know enough to assign fault.

  1. It begins with og.module (287) in the user_load_multiple function.
  2. This eventually causes a user entity to be loaded
  3. This will cause the hook_user_load to be driven for realname.
  4. Reaname performs an update, triggering a token_replacement.
  5. This eventually drives a hook_field_access which og_field_access has implemented.
  6. og_field_access then eventually causes an og_load_entity.
  7. This starts another entity_load, thus begins the recursive loop.

This is locking out other members. This seems to be a major issue. Normal>>Major ??

Attached is a captured image of the call stack. Most recent calls are at the top. The area highlighted in the red rectangle is the area that keeps repeating. In this case, I decided to quit after the 46th interation. The image only shows the initial setup, one complete segment that is repeated, and part of the next repeat segment.

amitaibu’s picture

Priority: Major » Normal

Please check it on a *clean* install, to see if it's indeed an OG bug.

David4514’s picture

I'll try to set that up. On the development system I finally found the out of memory (132MB) error message.

David4514’s picture

I did the following:

Fresh install of Drupal 7.9 (standard profile)
created a test member account
Fresh install of Entity 7.x-1.0-rc1
Fresh install of OG 7.x-1.x-dev (based on 11/10/11 date)
enabled Entity, OG and OG UI.
Added test content types for group and group content
Added one group and one group content node.

logged in a test member:
navigated to node/1/subscribe
subscribed to the test group -- OK
unsubscribed to the test group -- OK

As super user:
added and enabled token module 7.x-1.x-dev (based on 11/09/11 date)
added and enabled realname module 7.x-1.0-rc2
added text field to user for displayname
configured realname to use new textfield.
Tested realname -- OK

back at regular test member:
subscribed to the test group -- OK
unsubscribed from the test group -- OK

As super user:
enabled OG Field Access

As test member:
subscribed to test group -- Failed: out of memory
unable to access any page on website.

as super user:
still able to access website.
disabled realname.

As test member:
Now able to access website.
The subscribe above had succeeded.
unsubscribe from test group -- OK
subscribe to test group -- OK

The problem is the recursive call to entity_load noted in #2.

  1. An entity_load of the user entity drives realname_user_load hook.
  2. That hook calls token_replace. This eventually drives any module_field_access hooks
  3. og_field_access_field access causes (indirectly) another entity_load of the user entity which is recursive.

Is there anyway that og_field_access can determine that the entity was already loaded?

David4514’s picture

After spending more time and thinking on this, I went back to trap the call to og_field_access_field_access. The call is for the field used by realname, which in this case, has nothing to do with OG. The issue here is that this is a field that is associated with the user entity which in itself is also associated with OG. This is causing OG to issue an og_load_entity (line 1946 og.module) which begins the recursive activity.

Somehow, OG has to be smart enough to know that a field on a user entity might not be a og field.

The reason the super user continues to work is that this is all bypassed by line 1823 og.module for uid == 1.

joelpittet’s picture

Status: Active » Closed (outdated)

Drupal 7 reached end-of-life and the D7 version of Organic Groups is no longer being developed. To keep the issue queue focused on supported versions, we’re closing older D7 issues. If you still have questions about using Organic Groups on Drupal 7, feel free to ask. While we won’t fix D7 bugs anymore, we’re happy to offer guidance to help you move forward. You can do so by opening (or reopening) a D7 issue, or by reaching out in the #og channel on Drupal Slack.

If this issue is still relevant for Drupal 10+, please open a follow-up issue or merge request with proposed changes. Contributions are always welcome! 💙

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.