I created a content type with cck fields but when i try to save the content i receive the next warning and the cck fields doesn't save.

This error succed with the stable version and the development snapshot

warning: Invalid argument supplied for foreach() in //xxxx/modules/cck/content.module on line 1022.

xxx are the path of where the content.module are stored

Thanks in advanced

Xarbot

Comments

xarbot’s picture

Status: Active » Closed (fixed)

I had an error in settings.php so i close the thread

Thanks

hramik’s picture

What kind of error?
How did you resolve it?
I have the same warning and equal problem. Help me, please.
Thnks.

xarbot’s picture

I have a multisite installation and i share some tables beetwen installations, so in my settings.php i write

$db_url ='mysqli://username:password@localhost/drupal_BRGF';
$db_prefix = array(
'default' => '',
'authmap' => 'drupal.',
'profile_fields' => 'drupal.',
'profile_values' => 'drupal.',
'sequences' => 'drupal.',
'users' => 'drupal.',
'term_data' => 'drupal.',
'term_hierarchy' => 'drupal.',
'term_synonym' => 'drupal.',
'term_relation' => 'drupal.',
'vocabulary' => 'drupal.',
);

It's important that in default you put in blank. If you don't this then you take this warning

Thanks

Xarbot

hramik’s picture

Yeah!
It's the problem solving. So simple...
Thank you. I owe you one.

jelutz77’s picture

Version: 6.x-2.x-dev » 6.x-2.6

I'm having the same problem, and with split databases, but the default is blank.

jelutz77’s picture

Here is the full error message:

* warning: Invalid argument supplied for foreach() in /usr/local/www/drupal/sites/all/modules/cck/content.module on line 1022.
* warning: date_timezone_set() expects parameter 1 to be DateTime, null given in /usr/local/www/drupal/sites/all/modules/signup/includes/date.inc on line 485.
* warning: date_modify() expects parameter 1 to be DateTime, null given in /usr/local/www/drupal/sites/all/modules/signup/includes/date.inc on line 488.
* warning: date_format() expects parameter 1 to be DateTime, null given in /usr/local/www/drupal/sites/all/modules/signup/includes/date.inc on line 489.

I'm also getting "CREATE TABLE" error messages for the content_type_* table when I try to add a date, datetime or text CCK field to a content type. (others not tested) I've verified that the content_type_* table is there before the operation because I created the type first.

The content tables are among the non-default tables in my configuration, by design.

jelutz77’s picture

Grrr... a caching problem. I wish it wouldn't cache when I disable the cache...

Anyhow, it seems that any one of 3 tables, when not in the default database, will trigger these errors:

content_node_field
content_node_field_instance
content_type_*

So, referencing these tables seems to be inconsistent with the alternate-database feature of drupal. Was a reference to $db_prefix skipped somewhere? (at least as an array)

cgs’s picture

very thanks,it has help me solved my problem

jdarnell’s picture

jelutz77,

The trouble you've experienced is exactly what I am struggling with now. How did you correct this? You said something about caching? Is there any chance you could point me to some documentation on how to solve this?

Thanks for posting on this :)

dschafer’s picture

Version: 6.x-2.6 » 6.x-2.7

This issue also occurs in 2.7.

If the $db_prefix is anything other than '' then retrieving, inserting, updating or configuring cck fields will fail.

ezra-g’s picture

Status: Closed (fixed) » Closed (duplicate)