Closed (fixed)
Project:
CCK Field Privacy
Version:
6.x-1.x-dev
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Reporter:
Created:
24 Apr 2008 at 20:19 UTC
Updated:
24 Jan 2009 at 18:10 UTC
Jump to comment: Most recent file
warning: Invalid argument supplied for foreach() in /home/academic/public_html/devmain/sites/all/modules/cck_field_privacy/cck_field_privacy.module on line 127.
I got this in the release and dev version as well.
I configured the cck privacy to only apply to user profile or uprofile content type.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | cck_field_privacy.module.250873.patch | 678 bytes | obsidiandesign |
| #2 | cck_field_privacy.module.patch | 829 bytes | obsidiandesign |
| uprofileerror.png | 26.89 KB | drutube |
Comments
Comment #1
drutube commentedI tried the 5.2 version just to see if it would solve the issue and it gave the exact same error.
Comment #2
obsidiandesign commentedI've attached a patch to try - the warning doesn't actually appear on my box, but looking at the image, I think the error is generated because the module isn't selective enough about what the user profile form is. This patch checks to see if the nid is set according to the page_form.
Let me know if it works & then I'll commit.
Comment #3
obsidiandesign commentedI've committed the patch, marking the bug fixed.
Comment #4
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #5
radj commentedwhew...did the error mean anything else other than a warning?
Comment #6
mafioso commentedobsidiandesign,
it happens again... the patch from #2 is missing in 5.x-1.3 :)
Comment #7
obsidiandesign commentedIt seems that the original fix never made it into the 5.x-1.x branch. That said, I'm not sure it's the best approach anyway, since it limits the module to working with User Profile. Could you please test this patch, to see if it makes the error go away? The error comes about because a foreach() is executed against the cckfp_values variable, which if there are no selected fields, is an empty string right now, rather than an empty array.
Hopefully the patch addresses the REAL issue at hand here. :) Thanks for your help.
Bryan O'Shea
Obsidian Design
Comment #8
bcobin commentedPatch seemed to work on dev site, not on deployed site. I get the same error. Could have something to do with drop-down fields being unselected - will investigate...
Comment #9
chadchandler commentedYou will get this error if you have not selected any of the fields on the admin >>cck field privacy page.
In other words, make sure you have selected at least 1 field to use privacy for. I don't see anything wrong with this because if nothing is selected the module shouldn't be enabled for that content type. Thanks!
Comment #10
bcobin commentedThanks, Prodigy - that clears things up! Good work on the module!
Comment #11
obsidiandesign commentedI'd like to mark this by design or won't fix, but at the same time, it is an error message that is confusing to the end user. Does the patch from #7 fix the issue for other people? If so, I'll commit it, because even if an admin enables the module & doesn't use it, it should not give off error messages. I just want to make sure it's fixed correctly this time.
Bryan O'Shea
Obsidian Design
Comment #12
bcobin commentedOnce fields were enabled, it doesn't throw the error message - we'll be testing it further. This is with Nodeprofile, not Bio.
I've made one immediate change to the display field in the js (changing "Privacy Setting" to "Allow this field to be seen by:"); there are three other suggestions that I'll submit as feature requests.
Thank you for a very cool - and necessary - module... looking forward to using it!
Comment #13
obsidiandesign commentedThe code from the patch in #7 has been applied to both the 5.x and 6.x branches, as testing on clean installs showed no 'Invalid Argument' errors. The next dev release will have the change, and it's available now in CVS.
Bryan