Skip to content

Commit

Permalink
ENHANCEMENT Default archive year
Browse files Browse the repository at this point in the history
If no year is passed, rather than 404 it should grab the latest years posts.
  • Loading branch information
camfindlay committed Nov 8, 2015
1 parent 336a9b4 commit 52d763c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions code/model/Blog.php
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,7 @@ public function archive() {
/**
* Fetches the archive year from the url.
*
* @return null|int
* @return int
*/
public function getArchiveYear() {
$year = $this->request->param('Year');
Expand All @@ -736,7 +736,7 @@ public function getArchiveYear() {
return (int) $year;
}

return null;
return (int) date('Y');
}

/**
Expand Down

0 comments on commit 52d763c

Please sign in to comment.