From 5760395e92d0936abac3d4f74a11848f0b503d34 Mon Sep 17 00:00:00 2001 From: Nazar Gargol Date: Mon, 21 Oct 2019 11:31:07 +0200 Subject: [PATCH] Fixed reading_time calculation for non public posts no issue - The calculation of reading time has to happen before html field is sanitized for members plan. --- .../server/api/canary/utils/serializers/output/utils/mapper.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/server/api/canary/utils/serializers/output/utils/mapper.js b/core/server/api/canary/utils/serializers/output/utils/mapper.js index e07eee0256..36332a175b 100644 --- a/core/server/api/canary/utils/serializers/output/utils/mapper.js +++ b/core/server/api/canary/utils/serializers/output/utils/mapper.js @@ -35,6 +35,8 @@ const mapPost = (model, frame) => { url.forPost(model.id, jsonModel, frame); + extraAttrs.forPost(frame, model, jsonModel); + if (utils.isContentAPI(frame)) { // Content api v2 still expects page prop if (jsonModel.type === 'page') { @@ -44,7 +46,6 @@ const mapPost = (model, frame) => { members.forPost(jsonModel, frame); } - extraAttrs.forPost(frame, model, jsonModel); clean.post(jsonModel, frame); if (frame.options && frame.options.withRelated) {