Problem/Motivation

The helper utility function civictheme_media_get_variables returns 1 Jan 1970 as the Created date.

Error

This seems to be because $media->getCreatedTime() returns a String, and civictheme_format_datetime requires an Int.

Proposed resolution

themes/civictheme/includes/utilities.inc
On line #136
Change from:

'created' => civictheme_format_datetime($media->getCreatedTime(), 'civictheme_short_date'),

to

'created' => civictheme_format_datetime((int) $media->getCreatedTime(), 'civictheme_short_date'),

Comments

toby wild created an issue. See original summary.

richardgaunt’s picture

Status: Active » Patch (to be ported)
richardgaunt’s picture

Assigned: Unassigned » joshua1234511
richardgaunt’s picture

Version: 1.8.0 » 1.8.1
fionamorrison23’s picture

Issue tags: +civictheme-release-1.9
joshua1234511’s picture

@richardgaunt

The issue more of global then civic theme specific. though the patch will fix the issue. But there might be more instances where getCreatedTime() is used.

https://www.drupal.org/project/drupal/issues/3453210

I suggest we keep track of the issue.

richardgaunt’s picture

Status: Patch (to be ported) » Needs review
fionamorrison23’s picture

fionamorrison23’s picture

Status: Needs review » Reviewed & tested by the community
fionamorrison23’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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

fionamorrison23’s picture