Closed (fixed)
Project:
Private nodes
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
13 Aug 2007 at 19:59 UTC
Updated:
5 Sep 2007 at 20:55 UTC
warning: Invalid argument supplied for foreach() in xxx/sites/all/modules/private_nodes/private_nodes.module on line 524.
this occured on the previous build and the new 8/13/2007 build.
drupal 5.2, php 5.2.2, buddylist 1.0
also don't see where to select this in content creation.
Comments
Comment #1
ben_scott commentedHi
When hook_perm is trying to return a list of node types you can permit users to set privacy on, it cannot find any node types. I've changed the code so that this will not produce a warning anymore.
Could you confirm if you do have any node types defined (which are not also defined as nodeprofiles), as this could be a more serious problem?
Thanks, b3n
Comment #2
dsp1 commentednot sure exactly what you mean by defined node types. do you mean defined as private nodes? not sure how to define nodes types as private. i have looked at admin > content types and edit for each type but do not see any private setting. do not see anything related to nodes types in admin > site config > private nodes either.
Comment #3
ben_scott commentedHi
The privacy setting is set when you create / edit content - not per node type. You should see the privacy drop down in node/add/...
Also, I would have thought the bug would only occur if there were no content types (ie no pages etc.,) - but if you can edit them they must exist so it can't be that :)
When you go to admin/user/access can you set permissions ('users can set access ...') on all your node types in the private_nodes module section?
Comment #4
dsp1 commentedyes I checked the boxes for private node in the admin > user mgmt > access controls.
after checking both boxes for site admin and one box for auth user, click save and I get this error message on the top listed twice.
warning: Invalid argument supplied for foreach() in /Users/ddp/Sites/drupal/sites/all/modules/private_nodes/private_nodes.module on line 523.
i also installed the 8/14 build today.
on create content > blog entry or any content; I do not see any privacy drop down.
Comment #5
ben_scott commentedI've just downloaded the latest release myself to try and see what's happening, but there isn't any code on line 523 - it's a blank line. Could you confirm that the release you are using, has the code:
if(is_array($types)){
foreach ($types as $v) {
$permissions[] = 'users can set access on ' . $v;
}
}
on lines 518-522. If not try downloading the latest release again as you might have a version from before it was updated from CVS.
If it does have that code, could you double-check that your php error line-numbers are correct, as otherwise I'm looking in the wrong place...
Thanks, Ben
Comment #6
dsp1 commentedthe module date was 8/13/07 8:03.
this is on line 523. not blank.
foreach ($types as $v) {Comment #7
dsp1 commentedok. the error messages are gone with the 8/15 build.
i still don't see any pulldown for private in the create content.
i do see the user edit page has the "Show my profile to:"
where should I see the pulldown to set a node to private?
Comment #8
ben_scott commentedI think this is being caused by the same problem as http://drupal.org/node/168970, which is now fixed in the latest release (will be 22nd August - I've just committed to CVS).
Cheers, b3n
Comment #9
dsp1 commentedthanks
Comment #10
(not verified) commented