Search…

X3 Photo Gallery Support Forums

Search…
 
User avatar
alexhenes
Experienced
Topic Author
Posts: 568
Joined: 28 Sep 2006, 16:13

Exception thrown during rendering of template

01 May 2016, 17:30

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/
Alex
https://www.merelyafleshwound.com
https://www.goldenbikeshop.com
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13998
Joined: 30 Sep 2006, 03:37

Re: Exception thrown during rendering of template

02 May 2016, 01:15

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.
 
User avatar
alexhenes
Experienced
Topic Author
Posts: 568
Joined: 28 Sep 2006, 16:13

Re: Exception thrown during rendering of template

02 May 2016, 11:11

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
Alex
https://www.merelyafleshwound.com
https://www.goldenbikeshop.com
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13998
Joined: 30 Sep 2006, 03:37

Re: Exception thrown during rendering of template

02 May 2016, 13:41

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']);
 
User avatar
alexhenes
Experienced
Topic Author
Posts: 568
Joined: 28 Sep 2006, 16:13

Re: Exception thrown during rendering of template

03 May 2016, 10:07

thanks... fix worked
Alex
https://www.merelyafleshwound.com
https://www.goldenbikeshop.com