I am using date module 7.x-2.0-alpha4 and when I run an update script or clear the caches, I recieve this notice (Shows twice):
Warning: array_shift() [function.array-shift]: The argument should be an array in date_views_field_views_data_alter() (line 262 of sites/all/modules/date/date_views/date_views.module).

code line is:
$label = array_shift($labels);

I’m not a programmer but just thought I would mention it and ask if you could take a look at why I am getting this message, everything seems to be working fine otherwise.

Next, I upgraded to latest date 7.x-2.x-dev version and get a slightly different notice after running update script and clear all caches:
Warning: array_shift() expects parameter 1 to be array, string given in date_views_field_views_data_alter() (line 262 of sites\all\modules\date\date_views\date_views.module).

code line is same:
$label = array_shift($labels);

previous line is:
$labels = field_views_field_label($field['field_name']);
Could this line possibly be mispelled and actually be:
$labels = array_shift($labels);

Thanks in advance

Comments

mxr576’s picture

subscribe

karens’s picture

Status: Active » Closed (cannot reproduce)

The only thing we fix are things which are bugs in the latest dev code, which includes things already fixed from earlier bugs.

I cannot reproduce any problem in the latest dev code. If you still see a problem there I need details on exactly how to reproduce it, which requires information about how your view is configured and how the date field in the view is configured.

pepperoni13’s picture

Status: Closed (cannot reproduce) » Needs review

Hey Karen, I know this has been awhile since I came up with the issue, however I can produce this message consistently. I created a content type and add a date field (Date (ISO format)), Widget is popup Calender. Once I have created it with default settings, I try the clear caches, all works well and no warning is shown. Next I go back to the Content type and select "Collect an end date ". Try clear caches again and the error warning message appears. It appears at other times as well, like update script but the clear cache is quickest way I found to reproduce it.

Warning: array_shift() expects parameter 1 to be array, string given in date_views_field_views_data_alter() (line 262 of C:\xampp\htdocs\sites\all\modules\date\date_views\date_views.module).

Just to make a note, when I select the "Collect an end date ". The fields table and revision table get an addition column for the end date data, named same column name with 2 at the end. Perhaps this is the reason. Anyways, I hope this helps in solving it and that you can reproduce it.

arlinsandbulte’s picture

Status: Needs review » Postponed (maintainer needs more info)

Which version? 7.x-2.0-alpha4 is really old.

pepperoni13’s picture

using 7.x-2.0-alpha5, I will upgrade to newer versions and see what happens.

pepperoni13’s picture

rc1 installed and same message (different line number)

Warning: array_shift() expects parameter 1 to be array, string given in date_views_field_views_data_alter() (line 186 of sites\all\modules\date\date_views\date_views.module).

rc2 installed and same message (different line number)

Warning: array_shift() expects parameter 1 to be array, string given in date_views_field_views_data_alter() (line 213 of sites\all\modules\date\date_views\date_views.module).

7.x-2.1 installed and same error as rc2

date-7.x-2.2 installed and same message (different line number) (line 249 of date_views.module).

date-7.x-2.3 installed and same message (different line number) (line 251 of date_views.module).

date-7.x-2.4, date-7.x-2.5, date-7.x-2.x-dev and same result (line 251 of date_views.module).

Is there anything else I can try?

mbsii’s picture

i am getting the same warning after updating the views and then running the database update on version 7.14.

php
Date Tuesday, August 7, 2012 - 17:03
User admin
Location http://dev.mydomain.org/index.php?q=admin
Referrer http://dev.mydomain.org/update.php?op=selection&token=TMloY8LhQvFgxBajJt...

Message Warning: array_shift() [function.array-shift]: The argument should be an array in date_views_field_views_data_alter() (line 251 of D:\inetpub\mydomain\sites\all\modules\date\date_views\date_views.module).

Severity warning

ANY IDEAS? I don't want to continue my other module updates or the drupal version update until this is healed. Thanks.

karens’s picture

I can't tell if the process in #6 included running all the updates. After each change to a different version you should immediately do update.php and clear caches. There should be no problem after that when using the latest code. Don't try running various arbitrary versions of the module, always use the latest version. Randomly changing from one version to another is not going to be helpful.

#7 provides no useful information at all about how to reproduce any problem or what version of the code you are using. If you are actually using alpha4 you are using something far too old to work.

jkingsnorth’s picture

Issue summary: View changes
Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

No further response about this issue for a long time, and it's against an old alpha version, so I'm going to close it off. Please open a new issue if this re-surfaces in the latest versions.