While attempting to display dates in a view composed of nodes created from a custom content type, I received the following error for each of the displayed nodes...
warning: array_pop() [function.array-pop]: The argument should be an array in /nfs/c05/h04/mnt/77219/domains/mydomain.com/html/es/sites/all/modules/date/date_api.module on line 760.
Examining line 760 revealed that is was performing an array_pop on $granularity. When I asked Drupal to report the contents of $granularity, it indicated it was blank. This was quite puzzling as the wrapping function (date_make_date) provides a default array setting for $granularity (array('year', 'month', 'day', 'hour', 'minute')).
As I was unable to trace the reason for the missing array for $granularity and since the dates were displaying properly anyway, I inserted the following just prior to line 760...
if(!is_array($granularity)) {$granularity = array('year', 'month', 'day', 'hour', 'minute'); }
... which cured the problem.
I hope I'm not duplicating an already known issue. I did look through the list of issues and did not see this one there.
Cheers
Roland Combes
Comments
Comment #1
Macronomicus commentedgetting the same issue for some reason, your fix seems to have stopped the error for now.
Comment #2
qbnflaco commentedI seem to be getting a similar issue but on line 790...
I'll check if the same thing works for me.
Comment #3
grendzy commentedSame error here, on a fresh install with
Drupal 6.15
Content Construction Kit (CCK) 6.x-2.6
Date 6.x-2.4
Interestingly, resubmitting the field settings page (/admin/content/node-type/page/fields/field_datestamp) resolved the error.
Comment #4
adrianmoya commentedI has the same error, and can confirm that resubmitting the settings for the field resolves the problem.
Just my 2 cents...
Comment #5
imrook commentedI recently had this occur to me after upgrading a site from D5 to D6. Resubmitting the form also fixed the problem for me.
Comment #6
jimmynash commentedI also saw this particular problem.
Drupal 6.16
Date Api 6.x-2.4
CCK 6.x-2.7
Resubmitting the configuration for the field also fixed the issue. I am unsure if it affected all node instances with that field on them, I don't think it did.
The only change that I can see that happened was that a user placed a very malformed link into the URL Path field and saved the node.
Comment #7
sammyframson commentedResubmitting also worked for me.
Comment #8
damienmckennaUnfortunately the Drupal 6 version of the Date module is no longer supported. That said, we appreciate that you took time to work on this issue. Should this request still be relevant for Drupal 7 please feel free to reopen it. Thank you.