Closed (duplicate)
Project:
Content Construction Kit (CCK)
Version:
6.x-2.7
Component:
content.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Jun 2009 at 11:58 UTC
Updated:
2 Aug 2010 at 18:12 UTC
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
Comment #1
xarbot commentedI had an error in settings.php so i close the thread
Thanks
Comment #2
hramik commentedWhat kind of error?
How did you resolve it?
I have the same warning and equal problem. Help me, please.
Thnks.
Comment #3
xarbot commentedI 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
Comment #4
hramik commentedYeah!
It's the problem solving. So simple...
Thank you. I owe you one.
Comment #5
jelutz77 commentedI'm having the same problem, and with split databases, but the default is blank.
Comment #6
jelutz77 commentedHere 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.
Comment #7
jelutz77 commentedGrrr... 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)
Comment #8
cgs commentedvery thanks,it has help me solved my problem
Comment #9
jdarnell commentedjelutz77,
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 :)
Comment #10
dschafer commentedThis issue also occurs in 2.7.
If the $db_prefix is anything other than '' then retrieving, inserting, updating or configuring cck fields will fail.
Comment #11
ezra-g commentedThis is a dupe of #615566: warning: Invalid argument supplied for foreach() in content.module on line 1022.. Please continue discussion there.