warning: unserialize() expects parameter 1 to be string, array given in /home/user/public_html/drupal/sites/all/modules/cck_field_privacy/cck_field_privacy.module on line 240.

Comments

obsidiandesign’s picture

Assigned: Unassigned » obsidiandesign

I can confirm this when the module is first installed & no fields are set up. The problem I'm having fixing it is, by changing the data type from an empty array to an empty string, I then get a php warning on line 112, because it can't check if array_key_exists(). I'm looking into what can be done.

ms2011’s picture

@bryan: i recommend using isset() instead of array_key_exists(), anyhow. See if that works...

obsidiandesign’s picture

Status: Active » Needs review
StatusFileSize
new6.43 KB

When the module is first loaded, there's no need to check all the fields on a form; there's not anything in the cckfp_types variable. So, I've inserted a check at the beginning of the form_alter hook to check if cckfp_types is an array. If not, the module is skipped.

obsidiandesign’s picture

StatusFileSize
new6.46 KB

I've updated the patch to include the changes made in the newest 5.x-1.x-dev version that is in CVS. If there's no issues with the patch (I've been using the updated version without any problems), I'll commit this tomorrow. Just want to make sure this didn't create any new problems.

obsidiandesign’s picture

Status: Needs review » Fixed

Patch committed.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

djorn’s picture

Title: Warning when naviggating to admin/content/cck_field_privacy » Warning when navigating to admin/content/cck_field_privacy