I'm having problems with the calendar module. I just checked my logs and I'm seeing about 3 php errors a minute all starting with:
"Invalid argument supplied for foreach() in"
The errors go back for about 7 days and fill 400 log pages... EEK! I recently upgraded to Drupal 5.6 so I'm wondering if that played a part. I honestly haven't been checking more logs as I should. The module seems to be working fine otherwise.
The page it specifies after the "foreach() in" is different each time. I believe it is related to the Calendar module, because I removed the Calendar module and have not seen any more errors.
These are the 3 errors I was mainly getting after the "foreach() in"
/home/.shush/xxxxx/xxxxxxxxx.com/includes/tablesort.inc on line 149.
/home/.shush/xxxxx/xxxxxxxxx.com/includes/tablesort.inc on line 187.
/home/.shush/xxxxx/xxxxxxxxx.com/includes/theme.inc on line 769.
I've removed some site specific info and replaced it with X's.
Comments
Comment #1
sonicthoughts commentedI have exactly the same problem - can't figure it out!
Comment #2
sonicthoughts commentedI have exactly the same problem - can't figure it out!
Comment #3
mlncn commentedSame here, and if you google for it you find Drupal sites all over with it on their calendar pages ;-)
One page putting the error into the logs:
http://wsf2008.net/nl/view/calendar/all/all/all/2008/01/8
Invalid argument supplied for foreach() in /var/www/d53/includes/tablesort.inc on line 187.
Invalid argument supplied for foreach() in /var/www/d53/includes/theme.inc on line 769.
Invalid argument supplied for foreach() in /var/www/d53/includes/tablesort.inc on line 149.
benjamin, Agaric Design Collective
Comment #4
karens commentedAck!! I can't see where this is coming from either. I'm not getting it on my installation. Does anyone getting this have the ability to use debug_backtrace to figure out what function in Claendar is triggering this?
Comment #5
karens commentedIssues that look like duplicates are http://drupal.org/node/193916 and http://drupal.org/node/144404
Comment #6
roadking14 commentedI was getting this same set of errors until just now. I read the descriptions that are included when one adds an argument like "Calendar: Day" to the list. In the case of "Calendar: Day", the description reads "Filter by the calendar day (1-31). Place this argument after a 'Year' and a 'Month' argument." instructing you to place "Calendar: Month" in the second position in the list and "Calendar: Year" in the top position in the argument list.
So instead of my arguments being (in order)
Calendar: Day
Calendar: Month
Calendar: Year
Which resulted in the errors reported above.
I switched the order (as instructed by the descriptors) to
Calendar: Year
Calendar: Month
Calendar: Day
And the errors immediately went away and the view displays correctly.
Comment #7
roadking14 commentedI was getting this same set of errors until just now. I read the descriptions that are included when one adds an argument like "Calendar: Day" to the list. In the case of "Calendar: Day", the description reads "Filter by the calendar day (1-31). Place this argument after a 'Year' and a 'Month' argument." instructing you to place "Calendar: Month" in the second position in the list and "Calendar: Year" in the top position in the argument list.
So instead of my arguments being (in order)
Calendar: Day
Calendar: Month
Calendar: Year
Which resulted in the errors reported above.
I switched the order (as instructed by the descriptors) to
Calendar: Year
Calendar: Month
Calendar: Day
And the errors immediately went away and the view displays correctly.
Comment #8
karens commentedI don't know if the site reporting problems have the arguments in the wrong order, but the code will definitely not work if they are in the wrong order. This is one of the complexities of the Calendar module -- Views is designed to have arguments that are completely independent and can be used in any order, but to get the right results in the Calendar they must work together and be in the right order.
It would be good to check if the people reporting the error have arguments in the right order -- they must be year/month/day order, and all three must be there for the code to work right.
Comment #9
sonicthoughts commentedYes, mine are in the correct order %1,%2,%3 as Year, Month, Day and I still have the issue. Also curious is that the calendar is a day off (TZ issue.) coming from CiviCRM Events iCAL. I'm going to try applying a patch to the Date API.
thanks,
s.
Comment #10
karens commentedI still have no idea where this might be coming from in the 1.7 version.
Hopefully this is fixed in the 5.2 version, which is not quite ready for an official release. You can see that release if you look for 'other releases' on the project page. Try it in a test environment, or be prepared to update it as bugs are found and fixed.
Reopen and change the version number if the problem still happens in 5.2.
Comment #11
sonicthoughts commentedI've tried to uninstall calendar and Date modules, then reinstall with the dev versions. I have the same error, but it seems to have gotten worse with the date update script (i have not yet reinstalled the calendar module.)
here is the error:
* warning: Invalid argument supplied for foreach() in /home/jicnhol7/public_html/drupal/sites/all/modules/cck/content.module on line 760.
* warning: Invalid argument supplied for foreach() in /home/jicnhol7/public_html/drupal/sites/all/modules/cck/content.module on line 760.
* warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/jicnhol7/public_html/drupal/sites/all/modules/date/date/date.install on line 367.
* warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/jicnhol7/public_html/drupal/update.php on line 309.
* warning: Invalid argument supplied for foreach() in /home/jicnhol7/public_html/drupal/sites/all/modules/cck/content.module on line 760.
* warning: Invalid argument supplied for foreach() in /home/jicnhol7/public_html/drupal/update.php on line 542.
The following queries were executed
date module
Update #5200
* UPDATE {system} SET weight = 1 WHERE name = 'date'
Update #5201
* No queries
Update #5202
* UPDATE {node_field_instance} SET widget_type = 'date_popup' WHERE widget_type = 'date_js'
date_api module
Update #5000
* ALTER TABLE {users} ADD timezone_name varchar(50) NOT NULL default ''
Comment #12
sonicthoughts commentedRe-opening. I've followed suggestion. updated to 5.x-2.dev
new error:
warning: Invalid argument supplied for foreach() in /home/jicnhol7/public_html/drupal/sites/all/modules/calendar/calendar_ical.module on line 107.
any ideas?
Comment #13
VValdo commentedI'm getting this in 5.x-1.7:
* warning: Invalid argument supplied for foreach() in /home/waldo/filmmaker/release/trunk/includes/tablesort.inc on line 149.
* warning: Invalid argument supplied for foreach() in /home/waldo/filmmaker/release/trunk/includes/tablesort.inc on line 187.
* warning: Invalid argument supplied for foreach() in /home/waldo/filmmaker/release/trunk/includes/theme.inc on line 769.
* warning: Invalid argument supplied for foreach() in /home/waldo/filmmaker/release/trunk/includes/tablesort.inc on line 149.
* warning: Invalid argument supplied for foreach() in /home/waldo/filmmaker/release/trunk/includes/tablesort.inc on line 187.
* warning: Invalid argument supplied for foreach() in /home/waldo/filmmaker/release/trunk/includes/theme.inc on line 769.
W
Comment #14
karens commentedI think this is the same as http://drupal.org/node/186875, which has a potential fix identified.