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

ben_scott’s picture

Hi

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

dsp1’s picture

not 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.

ben_scott’s picture

Hi

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?

dsp1’s picture

yes 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.

ben_scott’s picture

I'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

dsp1’s picture

the module date was 8/13/07 8:03.
this is on line 523. not blank.
foreach ($types as $v) {

dsp1’s picture

ok. 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?

ben_scott’s picture

I 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

dsp1’s picture

Status: Active » Fixed

thanks

Anonymous’s picture

Status: Fixed » Closed (fixed)