Using latest dev version ( timestamped: Mar 9 18:04 )

When creating a view filter on date ( /admin/build/views/edit/XXXX_view?destination=XXXX_view#views-tab-page_1 ) I get the following warning.


* warning: array_merge() [function.array-merge]: Argument #2 is not an array in /.../drupal-6.16/sites/all/modules/date/includes/date_api_filter_handler.inc on line 43.
* warning: Invalid argument supplied for foreach() in /.../drupal-6.16/includes/form.inc on line 1207.

Comments

gunzip’s picture

subscribe. same here

webtram’s picture

I have this same problem:

warning: Invalid argument supplied for foreach() in includes/form.inc on line 1207.

kafka93’s picture

Same here; looks like an issue with some values of $this->options not being set. I worked around it by wrapping the complaining lines in ifs - e.g. if ($this->options['date_fields']) - but I'm not sure whether that's a reasonable fix.

alippai’s picture

same here :/

robertoguzman’s picture

i have the same issue with the version release on 2010-Apr-08

webdeli’s picture

same here.

webdeli’s picture

Priority: Minor » Critical
geochatz’s picture

I have the same issue with 6.x-2.x-dev (02 May 2010) version.

netamorfose’s picture

As documented in the changelof of array_merge in the official php docs ( http://php.net/manual/en/function.array-merge.php ) this functin only accept array as arguments since php 5.
As suggested the typecasting is the solution to merge other types.

My solution is to change line 43 of date_api_filter_handler.inc from

$this->view->date_info->date_fields = array_merge($this->view->date_info->date_fields, $this->options['date_fields']);

to

$this->view->date_info->date_fields = array_merge((array)$this->view->date_info->date_fields, (array)$this->options['date_fields']);

could be considered a fix for this bug?

Marco

JGonzalez’s picture

This fixed this issue for me - I was attempting to use date 6-2.x with views3, and the other patches did not fix this until this line was changed as well.

karens’s picture

Status: Active » Fixed

This was fixed differently already in the dev version.

Status: Fixed » Closed (fixed)

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