This is going to be a really difficult bug to describe, and I'm still fairly new to reporting bugs so sorry in advance if I miss any info or if this has already been posted somewhere. I couldn't find anything similar and I had a good look so here goes.

After updating main drupal permissions and creating a new role I was redirected to the admin/people page which gave me this error and nothing else.
Fatal error: Maximum function nesting level of '100' reached, aborting! in /home/quickstart/websites/longhairedmusic.com/www/includes/database/database.inc on line 921
I did some reading online and saw that this might be an xdebug issue so I edited xdebug.ini on my server and changed the following line to 200. No change. 1000 no change except that the error message did list 200 and 1000 respectfully, so I know that was working and some kind of recursion must be happening.
xdebug.max_nesting_level=100
The entire error message is attached in errorMessage.txt
The rest of the site worked fine, and it seemed to only be the admin/people page erroring out so I disabled the og-field-access module which I had fairly recently enabled which fixed the people page. When I re-enabled the module it continued to work fine without showing this error message but now when I choose one of the node create content links I get the following error for each field which has an overridden permission.
Warning: array_flip(): Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 179 of /home/quickstart/websites/longhairedmusic.com/www/includes/entity.inc).
After doing some digging I found that the load() method on the DrupalDefaultEntityController object was being passed the $ids array with one empty item, causing the empty($ids) to be true and then making the array_flip() error out. I can't figure out which code is triggering this method and sending the empty value in the array though.

That's about the limit of my debugging ability I'm afraid. I haven't got a clue what to do to fix this bug now so any advice would be great. Lack of info on the error messages makes this one difficult to track down.

CommentFileSizeAuthor
#2 og-module.patch545 bytesrobwithhair
errorMessage.txt12.76 KBrobwithhair
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

amitaibu’s picture

Did you try with the -dev version?

robwithhair’s picture

Component: og-field-access » og.module
FileSize
545 bytes

Hi Solved the problem it seems. I'm not very good with git yet but here's a patch which fixes the issue for this release.

Didn't try the dev version because I'm working on a production site and would find it difficult and time consuming to try to recreate the problem.

Baslicly og_load_entity() is sending entity_load() the 2nd argument $ids = array([0] => NULL) rather than $ids = NULL. This is tripping up the DrupalEntityControllerInterface::load() method when it tests $passed_ids = !empty($ids) ? array_flip($ids) : FALSE;

Have moved to og.module. Will have a look to see if anyone has already fixed this in dev.

robwithhair’s picture

The 7.x-1.x dev version seems to have the same issue although I can't test at the moment.

amitaibu’s picture

Status: Active » Needs work

Can you tell which function is calling og_load_entity with an array -- that is the real bug.

robwithhair’s picture

No function. The array is created inside og_load_entity. If $id is NULL it still sends array with one value of NULL to entity_load() rather than just sending NULL.

robwithhair’s picture

I'm still getting recursion when adjusting groups. Can anyone have a look at the output of errorMessage.txt to try to give me some clues as to where this might be coming from. I don't think it's another module because the problem goes away when I disable field access. I'm going to upgrade to the dev version of og to see if that fixes anything.

robwithhair’s picture

OK, Have now tried the Dev version and have tried wiping my database tables and starting again. This issue is really slowing my development so any clues or help would be amazing. The problem is recursion. Keep getting the error message shown above in errorMessage.txt when using the organic groups field access module. When it starts happening it is happening in most pages and I have to disable the module, starts working again then enable the module and it's ok until I change a permission somewhere, make a piece of content a group or attach a piece of content to a group. Tried to get help in IRC several times but no one answering my questions. Anywhere else I might be able to get help with this one? I'm on a time sensitive project you see and concerned that I might not find a fix for this.

robwithhair’s picture

Done more digging, seems this problem might be related to these issues http://drupal.org/node/1369824 and http://drupal.org/node/1058912 . This looks like an issue which spans multiple modules which I guess is why there are no solutions posted. Seems to have been going on for nearly a year now if it's a tokens bug.

robwithhair’s picture

More testing required on my part tomorrow. Appears to be a real name module bug in disguise. Will post my findings.

robwithhair’s picture

Status: Needs work » Closed (fixed)

Seems this recursion was probably caused by real name module after all. Have closed bug report. See here for this issue in real name module http://drupal.org/node/1369824 . Wasn't able to find a fix so had to disable real name module, which isn't that important to my setup until resolved.