From 170617feb3e048844ac263e41782882433327b82 Mon Sep 17 00:00:00 2001 From: Naz Date: Wed, 21 Jul 2021 11:51:45 +0400 Subject: [PATCH] Fixed `this` context for methods passed into importer refs https://github.com/TryGhost/Team/issues/916 - Without `.bind`, `this` context was lost when used inside of the CSVImporter calss --- core/server/services/members/service.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/server/services/members/service.js b/core/server/services/members/service.js index d33f5b827d..225b340593 100644 --- a/core/server/services/members/service.js +++ b/core/server/services/members/service.js @@ -132,10 +132,10 @@ const membersService = { getTimezone: () => settingsCache.get('timezone'), getMembersApi: () => membersApi, sendEmail: ghostMailer.send.bind(ghostMailer), - isSet: labsService.isSet, - addJob: jobsService.addJob, + isSet: labsService.isSet.bind(labsService), + addJob: jobsService.addJob.bind(jobsService), knex: db.knex, - urlFor: urlUtils.urlFor + urlFor: urlUtils.urlFor.bind(urlUtils) }), stats: new MembersStats({