Page 1 of 1

Exception thrown during rendering of template

Posted: 01 May 2016, 17:30
by alexhenes
On www.merelyafleshwound.com I get the error below when I select Road Biking.Europe.Tuscany from the menu.

An exception has been thrown during the rendering of a template ("DateTime::__construct(): Failed to parse time string (-001-11-30T00:00:00+01:00) at position 7 (-): Double timezone specification") in "partials/module.gallery.html" at line 153.

Here is the url: http://www.merelyafleshwound.com/road-b ... e/tuscany/

Re: Exception thrown during rendering of template

Posted: 02 May 2016, 01:15
by mjau-mjau
There are some images in that folder with non-standard time definitions in EXIF (starts with hyphen -). This issue has already been fixed so that it doesnt create an error, pending in the forthcoming release.

You can hotfix it by editing /app/asset-types/image.inc.php. Locate the line:
Code
if(isset($this->data['exif']['date_taken'])) $this->data['date'] = $this->data['exif']['date_taken'];
Change to:
Code
if(isset($this->data['exif']['date_taken'])) $this->data['date'] = strtotime($this->data['exif']['date_taken']);
You will need to empty the cloudflare cache specifically for the page that doesn't work.

Re: Exception thrown during rendering of template

Posted: 02 May 2016, 11:11
by alexhenes
Hey Karl...

The code I have in the /app/asset-types/image.inc.php file is a little different than what you posted.

The code on my server shows
Code
if(isset($this->data['exif']) && isset($this->data['exif']['date_taken'])) $this->data['date'] = $this->data['exif']['date_taken'];
you said to locate
Code
if(isset($this->data['exif']['date_taken'])) $this->data['date'] = $this->data['exif']['date_taken'];
and replace with
Code
if(isset($this->data['exif']['date_taken'])) $this->data['date'] = strtotime($this->data['exif']['date_taken']);

Thanks

Re: Exception thrown during rendering of template

Posted: 02 May 2016, 13:41
by mjau-mjau
Ok, just use this line regardless:
Code
if(isset($this->data['exif']) && isset($this->data['exif']['date_taken'])) $this->data['date'] = strtotime($this->data['exif']['date_taken']);

Re: Exception thrown during rendering of template

Posted: 03 May 2016, 10:07
by alexhenes
thanks... fix worked