Closed (fixed)
Project:
OG User Roles
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
10 Jan 2009 at 15:35 UTC
Updated:
5 Feb 2009 at 19:20 UTC
Jump to comment: Most recent file
After making the above upgrades I now (randomly) see this error on group pages and nodes belonging to groups
warning: Attempt to assign property of non-object in /var/www/html/epsrc_test/sites/all/modules/og_user_roles/og_user_roles.module on line 2420.
if (empty($gid)) {
$gid = 0; // This prevents us from getting error on non-group node/add
}else{
$_SESSION['og_last']->nid = $gid; <-- this is line 2420
$_SESSION['og_user_role'] = $gid;
}
Can anyone explain what it means and how to sort it?
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | 356930_og_user_roles.patch | 1.12 KB | scottrigby |
| #2 | ogur-356930.patch | 1.47 KB | somebodysysop |
Comments
Comment #1
michtoen commentedgot something similiar: warning: Attempt to assign property of non-object in /var/www/htdocs/modules/og_user_roles/og_user_roles.module on line 2422.
Comment #2
somebodysysop commentedTry the attached patch and see if the message goes away.
Comment #3
Utternonsense commentedI got errors when trying to patch the .module file but maybe that's me.
The point of the patch seems to be to remove
$_SESSION['og_last']->nid = $gid;so i commented it out and it seems to have done the trick (for now).Comment #4
somebodysysop commentedWell, that's not exactly the point. It only uses it if it exists already. But, if it works, then fine. I'll commit to dev shortly.
Comment #5
bribiz commentedJust downloaded and installed 6.x-1.2 Had the same error. Used patch and it got rid of the warning regarding objects but the patch had errors. See Below:
(Update: Just realized this patch may be for 5.3.4. What needs to be done for 6.x-1.2?)
[mysys]# patch -p0 patching file og_user_roles.module
Hunk #1 FAILED at 1.
Hunk #2 succeeded at 2325 (offset 7 lines).
Hunk #3 succeeded at 2419 (offset -5 lines).
Hunk #4 FAILED at 2634.
2 out of 4 hunks FAILED -- saving rejects to file og_user_roles.module.rej
[mysys]# cat og_user_roles.module.rej
***************
*** 1,5 ****
<?php
- // $Id: og_user_roles.module,v 1.1.2.17 2008/11/24 18:14:04 somebodysysop Exp $
/**
* @file
--- 1,5 ----
<?php
+ // $Id: og_user_roles.module,v 3.1.1.2 2008/05/17 19:50:44 somebodysysop Exp $
/**
* @file
***************
*** 2627,2632 ****
$type = $_GET['type'];
if ($type) {
// Got this from node.module (node_access)
// No matter the type, this should return us the create permission.
$module = node_get_types('module', $type);
--- 2634,2641 ----
$type = $_GET['type'];
if ($type) {
+ // Convert the dashes in the URL back to underscores. http://drupal.org/node/349648
+ $type = str_replace('-', '_' , $type);
// Got this from node.module (node_access)
// No matter the type, this should return us the create permission.
$module = node_get_types('module', $type);
Comment #6
somebodysysop commentedThis is a 5.x-3.4 issue, so that's what the patch is for. Will commit the change to .dev releases for both 5.x and 6.x.
Comment #7
somebodysysop commentedModification commited to .dev branch in both 5.x and 6.x.
Comment #8
scottrigbyI'm attaching an updated patch for 6.x that deals with hunks 2 & 3 from the 5.x patch above.
Hunks 2 & 3 were not committed to the dev branch already it seems.
Hunk 1 may be in there already, but it's tough to tell because the same code repeats and the line numbers have changed since 5.x -- and the error went away without addressing it, so I left that out of this patch. Seems to work well for me :)
Comment #9
somebodysysop commentedThis is already in og_user_roles_ognodeadd. Don't see the point in putting it in there twice.
Comment #10
scottrigbyAh, thanks :)
But I also spoke too soon about it working for me. I saw I was able to click *edit* on group nodes appropriate to the context, but only now did I actually try *save* the node... and now I'm not able to :(
I get this warning message: "You do not have permission to edit or delete this content type (CONTENT_TYPE) in Group: GROUP_NAME (8)". I've looked through all the issues mentioned on the front page of the module. The one thing I'm doing is working in a local subdirectory... but this has not given me any warnings. Do you think it could be related? Or do you think maybe this patch isn't really working properly yet?
Comment #11
AntiNSA commentedwarning: Attempt to assign property of non-object in /home/cyberfan/htdocs/modules/og_user_roles/og_user_roles.module on line 2422.
hmmm..... how can I fix this using D6???
Comment #12
somebodysysop commentedFix committed to .dev.
Comment #13
somebodysysop commentedNo. You first need to make sure that the user actually has the permission(s) to edit/delete nodes of that content type in that group.
If you still feel the user should be able to post, then you should open another issue with the relevant information. This issue will be closed very shortly.
Comment #14
somebodysysop commentedPatch hunk #2 (non-object issue) committed to dev.