When using the latest date build with latest views and latest calendar, after I create the calendar view to work off of field_date so that the calendar would populate with the date of an upcoming event, I get the following error:

Error message
Warning: array_push() expects parameter 1 to be array, null given in date_formatter_format() (line 452 of /var/www/drupal/sites/all/modules/date/date.module).

Any ideas as to why and how to fix?

Comments

dibya’s picture

I m also facing similar problems showing error message as follows.. Warning: array_push() [function.array-push]: First argument should be an array in date_formatter_format() (line 452 of /home/ddutta/nic.superhit.in/iay/sites/all/modules/date/date.module).

I feel I hv wrongly configured in the strcture -> view -> calender

arlinsandbulte’s picture

Status: Active » Closed (won't fix)

Date 7.x-1.x is unsupported.
This issue should be verified in the latest version of Date (7.x-2.x-dev) and re-opened if still valid.

Thanks

IAmThatStrange’s picture

Status: Closed (won't fix) » Active

Warning still valid using Date 7.x-2.x-dev. Seen in Content -> Signup Administration

Warning: array_push() expects parameter 1 to be array, null given in date_formatter_format() (line 517 of /webapps/drupal-7.4/sites/all/modules/date/date.module).

I'm a newb so if this is a configuration issue on my part please let me know - signup is throwing all kinds of warnings.

jwilson3’s picture

Title: Error message Warning: array_push() expects parameter 1 to be array, null given in date_formatter_format() (line 452 of /var/www » PHP warning: initialize $granularity array before using it in array_push
Version: 7.x-1.x-dev » 7.x-2.x-dev
Status: Active » Needs review
StatusFileSize
new589 bytes

Simple change to initialize the $granularity function argument as an array() instead of NULL, so that array_push doesn't cause a warning.

This is applicable by hand if necessary on older branches and should work for both 1.x and 2.x branches.

James Andres’s picture

Subscribe

karens’s picture

Status: Needs review » Fixed

This only appears if you use some module that sends a value to that function without the granularity (apparently Signup does), but you're right that the default value should be an array().

Status: Fixed » Closed (fixed)

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