civictheme_media_get_variables not returning correct "created" value

Created on 2 September 2024, 18 days ago
Updated 5 September 2024, 14 days ago

Problem/Motivation

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

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'),
🐛 Bug report
Status

Needs review

Version

1.8

Component

Code

Created by

🇦🇺Australia Toby Wild

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

Comments & Activities

Production build 0.71.5 2024