diff --git a/packages/strapi-bookshelf/lib/index.js b/packages/strapi-bookshelf/lib/index.js index 04c95f50cc..f8efe63b2d 100755 --- a/packages/strapi-bookshelf/lib/index.js +++ b/packages/strapi-bookshelf/lib/index.js @@ -37,16 +37,16 @@ module.exports = function (strapi) { initialize: function (cb) { let globalName; - // Make sure the Knex hook is present since Knex needs it. - if (!strapi.hooks.knex) { - strapi.log.error('Impossible to load the ORM without the query builder!'); - strapi.log.error('You need to install the Strapi query builder with `$ npm install strapi-knex --save`.'); - strapi.stop(1); - } - // Only run this logic after the Knex has finished to load. strapi.after('hook:knex:loaded', function () { + // Make sure the Knex hook is present since Knex needs it. + if (!strapi.hooks.external.knex) { + strapi.log.error('Impossible to load the ORM without the query builder!'); + strapi.log.error('You need to install the Strapi query builder with `$ npm install strapi-knex --save`.'); + strapi.stop(1); + } + // Initialize collections _.set(strapi, 'bookshelf.collections', {}); diff --git a/packages/strapi/lib/configuration/hooks/dictionary/_hooks/index.js b/packages/strapi/lib/configuration/hooks/dictionary/_hooks/index.js index a2d1bb7d6e..64819ca0c8 100644 --- a/packages/strapi/lib/configuration/hooks/dictionary/_hooks/index.js +++ b/packages/strapi/lib/configuration/hooks/dictionary/_hooks/index.js @@ -63,6 +63,7 @@ module.exports = function (strapi) { cb(err); } } + return memo; }, {}));