preaction / Statocles

Static website CMS
http://preaction.me/statocles
Other
84 stars 33 forks source link

Can't locate object method "new" via package "Time::Piece" #482

Closed neilhwatson closed 8 years ago

neilhwatson commented 8 years ago

Do I need to upgrade my templates or this a legitimate error?

Error in template: Can't locate object method "new" via package "Time::Piece" (perhaps you forgot to load "Time::Piece"?) at blog/index.atom.ep line 5.
1: <?xml version="1.0"?>
2: <feed xmlns="http://www.w3.org/2005/Atom">
3:     <id><%= $site->url( $self->links( 'alternate' )->href ) %></id>
4:     <title><%= $site->title %></title>
5:     <updated><%= Time::Piece->new->strftime('%Y-%m-%dT%H:%M:%SZ') %></updated>
6:     <link rel="self" href="<%= $site->url( $self->path ) %>"/>
7:     <link rel="alternate" href="<%= $site->url( $self->links( 'alternate' )->href ) %>"/>
8:     <generator version="<%= $Statocles::VERSION %>">Statocles</generator>
9:     % for my $p ( @$pages ) {
10:     <entry>
preaction commented 8 years ago

Have to upgrade your templates, unfortunately. This commit (https://github.com/preaction/Statocles/commit/5b7e219328b8a6723c4747e9d72320d95030510e), changing to DateTime::Moonpig to allow for more accurate document metadata means Time::Piece isn't loaded anymore.

If you've customized your templates and don't want to mess that up, this line is the only one you need: https://github.com/preaction/Statocles/commit/5b7e219328b8a6723c4747e9d72320d95030510e#diff-3263cb04bf1b6aaa21bba8b627223460R5

In theory, the bug is that the template didn't % use Time::Piece like it should've, but too late for that...

neilhwatson commented 8 years ago

Thanks.