From 4f38a33702b78acf7707065fc73416f68d0a46b8 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Tue, 18 Nov 2014 14:49:48 -0500 Subject: [PATCH] fix pagination going to 404 if new post creates a new page --- src/topics.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/topics.js b/src/topics.js index 59a843e610..6733aa2529 100644 --- a/src/topics.js +++ b/src/topics.js @@ -72,7 +72,7 @@ var async = require('async'), return callback(err); } - callback(null, Math.ceil(parseInt(postCount, 10) / settings.postsPerPage)); + callback(null, Math.ceil((parseInt(postCount, 10) - 1) / settings.postsPerPage)); }); }); };