Using ['#type'] = 'hidden' is causing a fatal error if you preview a forum post before saving:

Fatal error: Cannot create references to/from string offsets nor overloaded objects in /includes/common.inc on line 6711

There are also these two errors that you will see the next time you go to a page (since the first error kills the page rendering):

Notice: Array to string conversion in drupal_attributes() (line 2421 of /includes/common.inc).
Warning: Illegal string offset 'und' in drupal_array_set_nested_value() (line 6711 of /includes/common.inc).

The fix for this is to deny access if the user doesn't have access rather than just hiding it from the HTML.

CommentFileSizeAuthor
#2 og_forum_d7-2552749-2.patch529 bytesMichelle
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Michelle created an issue. See original summary.

Michelle’s picture

FileSize
529 bytes

Here's the patch.

vegantriathlete’s picture

@Michelle,
Thanks for sending along a patch. At the moment, I'm afraid that -dev may be a bit of a mess. At the Saturday sprint during DrupalCon LA I had applied patches for some of the issues in the queues. When I tested the code, it did not appear that any of those issues had been resolved. I'm still tied down with other commitments and haven't been able to put time into figuring out just what's going on. So, I have to ask you to sit tight with this until I can allocate some time.

Michelle’s picture

No problem. I noticed that #2416671: Don't just blindly hide the Group Audience and Content Visibility fields shows up if you get from git but it's not in the dev tarball. Definitely something odd going on. I've got the patch applied to the client's codebase so that'll be just fine until you have time.

vegantriathlete’s picture

At least you've given me something to start tracking down. I hadn't even gotten that far with it yet!

So what version are you using with your client? The git cloned version? The -dev version? The 2.0-alpha-1 version?

If you are using the git cloned version, I'd appreciate if you could leave comments in the appropriate issue queues as to whether those issues have been fixed.

If you are using the -dev version, then I'm curious what you are seeing there.

If you are using the 2.0-alpha-1 version, then I'd think you are seeing considerable issues as that appeared to be in a very bad state.

Ah, it seems you must be using the git cloned version since your patch is applied on top of my patch I had written for #2416671: Don't just blindly hide the Group Audience and Content Visibility fields. Please do let me know how that cloned version is working with regards to the various issues I had patched.

Michelle’s picture

They were running the dev version. I initially fixed just those two lines on the dev version on their site and it worked. Then I moved to a git clone on my D7 test site so I could double check the fix in a clean environment and make the patch off the latest. That's when I noticed the code was now wrapped in an if test, so I went back and looked at the most recent dev tarball and confirmed the change was not in there. Given that, I updated the client to the git cloned code and applied the patch on top of that.

Their forums aren't in active use, yet, so this is the only issue I'm aware of so far. I do have a little contrib time this week, though, so will see if I can do some more testing.

vegantriathlete’s picture

vegantriathlete’s picture

Status: Active » Closed (fixed)
Michelle’s picture

Thanks for fixing this! Sorry I haven't had a chance to look at the other stuff. Been busy at work and I haven't gotten contrib time. :(