diff --git a/core/server/helpers/pagination.js b/core/server/helpers/pagination.js index e91d114518..18fbeecfa8 100644 --- a/core/server/helpers/pagination.js +++ b/core/server/helpers/pagination.js @@ -12,7 +12,9 @@ var proxy = require('./proxy'), pagination = function (options) { if (!_.isObject(this.pagination) || _.isFunction(this.pagination)) { throw new errors.IncorrectUsageError({ - message: i18n.t('warnings.helpers.pagination.invalidData') + level: 'normal', + message: i18n.t('warnings.helpers.pagination.invalidData'), + help: 'https://themes.ghost.org/docs/pagination' }); } diff --git a/core/server/translations/en.json b/core/server/translations/en.json index 357a3d2866..974f44c6da 100644 --- a/core/server/translations/en.json +++ b/core/server/translations/en.json @@ -524,7 +524,7 @@ "isDeprecated": "Warning: pageUrl is deprecated, please use page_url instead\nThe helper pageUrl has been replaced with page_url in Ghost 0.4.2, and will be removed entirely in Ghost 0.6\nIn your theme's pagination.hbs file, pageUrl should be renamed to page_url" }, "pagination": { - "invalidData": "pagination data is not an object or is a function", + "invalidData": "The \\{\\{pagination\\}\\} helper was used outside of a paginated context. See https://themes.ghost.org/docs/pagination.", "valuesMustBeDefined": "All values must be defined for page, pages, limit and total", "nextPrevValuesMustBeNumeric": "Invalid value, Next/Prev must be a number", "valuesMustBeNumeric": "Invalid value, check page, pages, limit and total are numbers" diff --git a/core/test/unit/helpers/pagination_spec.js b/core/test/unit/helpers/pagination_spec.js index 3a7be98243..8664284e09 100644 --- a/core/test/unit/helpers/pagination_spec.js +++ b/core/test/unit/helpers/pagination_spec.js @@ -29,11 +29,11 @@ describe('{{pagination}} helper', function () { return function () { helpers.pagination.call(data); }; - }; + }, expectedMessage = 'The {{pagination}} helper was used outside of a paginated context. See https://themes.ghost.org/docs/pagination.'; - runHelper('not an object').should.throwError('pagination data is not an object or is a function'); + runHelper('not an object').should.throwError(expectedMessage); runHelper(function () { - }).should.throwError('pagination data is not an object or is a function'); + }).should.throwError(expectedMessage); }); it('can render single page with no pagination necessary', function () {