TypeError: Argument 7 passed to date_formatter_process() must be of the type array, null given

Created on 31 March 2021, over 3 years ago
Updated 13 February 2023, almost 2 years ago

Problem/Motivation

After deploying the 2.11 release, some pages begun resulting in 503 server error. I suspect those pages don't have the date field value selected, but could be something else. We use search API page which resulted in this error returning back for any keyword.

Steps to reproduce

Steps to reproduce may be specific to our environment/set up.

THe error returned is:

TypeError: Argument 7 passed to date_formatter_process() must be of the type array, null given, called in docroot/sites/all/modules/contrib/date/date.field.inc on line 205 in date_formatter_process() (line 221 of docroot/sites/all/modules/contrib/date/date.module)

Upon inspection, there was a change in the function date_formatter_process() arguments - added type, which is now causing the problem when an incorrect type was passed.

Proposed resolution

Proposing the addition of data type validation. A patch which resolved the issue on our side attached.

πŸ› Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

πŸ‡¦πŸ‡ΊAustralia ivrh

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡¨πŸ‡¦Canada xmacinfo Canada

    I am hitting that error updating the Date module from 7.x-2.10 to 7.x-2.14.

    TypeError: Argument 7 passed to date_formatter_process() must be of the type array, null given, called in /srv/www/………/sites/all/modules/date/date.field.inc on line 215 in date_formatter_process() (line 223 of /srv/www/………/sites/all/modules/date/date.module).

    We have a lot of custom code.

    Not sure if I will use the patch in #8 or if I will be able to investigate the piece of code that triggers that error.

  • Status changed to Needs review almost 2 years ago
  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    Patch #8 wasn't compatible with PHP 5, so this might work better.

  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    Never mind #13, this is what I meant.

  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    @xmacinfo: Could you please do some debugging to see if you can work out what variable is causing this?

  • πŸ‡¨πŸ‡¦Canada xmacinfo Canada

    @DamienMcKenna Using your patch in #15 solves the issue.

    We have a lot of custom code. I will try to find which variable is passed as an argument (argument 7). But I am not sure how much time I will be able to allow for this.

Production build 0.71.5 2024