When I try to export a content type with a userreference field, I get:
warning: array_key_exists() [function.array-key-exists]: The first argument should be either a string or an integer in /var/www/sites/business-advisor/sites/all/modules/cck/userreference.module on line 84.
The line giving the error is:
if (!empty($item['uid']) && !array_key_exists($item['uid'], _userreference_potential_references($field, '', $item['uid']))) {
By adding some debug code, the item in question looks like this:
Array
(
[uid] => Array
(
[0] => 7
)
...
And changing the above line to:
if (!empty($item['uid']) && !array_key_exists($item['uid'][0], _userreference_potential_references($field, '', $item['uid']))) {
Allows the export. I have no idea what else this does :) I have checked that you can still add nodes of the type after the change.
I've attached a patch that does this.
Comments
Comment #1
karens commentedProbably related to #128038: Critical failures using drupal_execute() on nodes with CCK fields, so marking this as a duplicate.
Comment #2
karens commented