Download & Extend

array_keys invalid argument on addresses_cck.module line 15

Project:Addresses
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

any idea about the below?

array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in addresses/addresses_cck/addresses_cck.module on line 15.
Invalid argument supplied for foreach() in addresses/addresses_cck/addresses_cck.module on line 15.

the function addresses_cck_content_is_empty() is called 2 times when i create a new node, $field is an array at the first call but its a string at the second call containing my field name as in "field_...", hence the error, $items is the same both times, containing the active fields for the cck address field, i just hide address name and primary address checkbox, and fax, the rest are "normal"

one other thing ive noticed is that fax always resets to "normal" on the configuration screen after im hiding it with "none", but its just the config window and im taking care to set it back to none if i modify anything, but i guess this should be a separate bug submission..

Comments

#1

Subscribe!
Same problem here.

#2

Replace function addresses_cck_content_is_empty() in addresses_cck.module by this code, it will fix this problem :

function addresses_cck_content_is_empty($item, $field) {
if (is_array($field['columns'])) {
foreach(array_keys($field['columns']) as $ftype) {
if (!empty($item[$ftype])) {
return FALSE;
}
}}
return TRUE;
}

Are you using path on cck module that make it show only one empty field ?

Chris

#3

Version:6.x-1.05» 6.x-1.x-dev
Status:active» fixed

After testing against the latest dev snapshot, I am unable to reproduce this issue so I am going to mark it as fixed. If after upgrading to the latest dev snapshot you are still seeing this issue, please reopen the issue and provide additional information for reproducing.

Cheers,

Antoine

#4

Status:fixed» closed (fixed)

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

#5

This appears to be a bug in content_complete, at least in my case. There's a patch at #751796-2: warning: array_keys()... seems to have incompatibility with addresses CCK

nobody click here