From 2cb8d06fca13642e627ae3524db08161085aac01 Mon Sep 17 00:00:00 2001 From: Fabien O'Carroll Date: Thu, 20 Sep 2018 21:23:39 +0700 Subject: [PATCH] Updated permittedOptions to correctly call super refs #9881 When subclassing and calling "super" you must explicitly pass the this context and any parameters --- core/server/models/app.js | 2 +- core/server/models/client.js | 2 +- core/server/models/post.js | 2 +- core/server/models/role.js | 2 +- core/server/models/subscriber.js | 2 +- core/server/models/tag.js | 2 +- core/server/models/user.js | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/core/server/models/app.js b/core/server/models/app.js index 38ab1f2d48..37cdd3acbf 100644 --- a/core/server/models/app.js +++ b/core/server/models/app.js @@ -34,7 +34,7 @@ App = ghostBookshelf.Model.extend({ * @return {Array} Keys allowed in the `options` hash of the model's method. */ permittedOptions: function permittedOptions(methodName) { - var options = ghostBookshelf.Model.permittedOptions(), + var options = ghostBookshelf.Model.permittedOptions.call(this, methodName), // whitelists for the `options` hash argument on methods, by method name. // these are the only options that can be passed to Bookshelf / Knex. diff --git a/core/server/models/client.js b/core/server/models/client.js index 3aebf711a6..f8f930e92b 100644 --- a/core/server/models/client.js +++ b/core/server/models/client.js @@ -32,7 +32,7 @@ Client = ghostBookshelf.Model.extend({ * @return {Array} Keys allowed in the `options` hash of the model's method. */ permittedOptions: function permittedOptions(methodName) { - var options = ghostBookshelf.Model.permittedOptions(), + var options = ghostBookshelf.Model.permittedOptions.call(this, methodName), // whitelists for the `options` hash argument on methods, by method name. // these are the only options that can be passed to Bookshelf / Knex. diff --git a/core/server/models/post.js b/core/server/models/post.js index 0e385b130d..d31779795c 100644 --- a/core/server/models/post.js +++ b/core/server/models/post.js @@ -554,7 +554,7 @@ Post = ghostBookshelf.Model.extend({ * @return {Array} Keys allowed in the `options` hash of the model's method. */ permittedOptions: function permittedOptions(methodName) { - var options = ghostBookshelf.Model.permittedOptions(methodName), + var options = ghostBookshelf.Model.permittedOptions.call(this, methodName), // whitelists for the `options` hash argument on methods, by method name. // these are the only options that can be passed to Bookshelf / Knex. diff --git a/core/server/models/role.js b/core/server/models/role.js index 1387d2183f..c8850f35db 100644 --- a/core/server/models/role.js +++ b/core/server/models/role.js @@ -24,7 +24,7 @@ Role = ghostBookshelf.Model.extend({ * @return {Array} Keys allowed in the `options` hash of the model's method. */ permittedOptions: function permittedOptions(methodName) { - var options = ghostBookshelf.Model.permittedOptions(), + var options = ghostBookshelf.Model.permittedOptions.call(this, methodName), // whitelists for the `options` hash argument on methods, by method name. // these are the only options that can be passed to Bookshelf / Knex. diff --git a/core/server/models/subscriber.js b/core/server/models/subscriber.js index a6c76a3d4a..4ee93ffa5e 100644 --- a/core/server/models/subscriber.js +++ b/core/server/models/subscriber.js @@ -43,7 +43,7 @@ Subscriber = ghostBookshelf.Model.extend({ }, permittedOptions: function permittedOptions(methodName) { - var options = ghostBookshelf.Model.permittedOptions(), + var options = ghostBookshelf.Model.permittedOptions.call(this, methodName), // whitelists for the `options` hash argument on methods, by method name. // these are the only options that can be passed to Bookshelf / Knex. diff --git a/core/server/models/tag.js b/core/server/models/tag.js index 60a41463f2..3d79d7360d 100644 --- a/core/server/models/tag.js +++ b/core/server/models/tag.js @@ -92,7 +92,7 @@ Tag = ghostBookshelf.Model.extend({ }, permittedOptions: function permittedOptions(methodName) { - var options = ghostBookshelf.Model.permittedOptions(methodName), + var options = ghostBookshelf.Model.permittedOptions.call(this, methodName), // whitelists for the `options` hash argument on methods, by method name. // these are the only options that can be passed to Bookshelf / Knex. diff --git a/core/server/models/user.js b/core/server/models/user.js index f5e81b70f3..915214a12b 100644 --- a/core/server/models/user.js +++ b/core/server/models/user.js @@ -328,7 +328,7 @@ User = ghostBookshelf.Model.extend({ * @return {Array} Keys allowed in the `options` hash of the model's method. */ permittedOptions: function permittedOptions(methodName, options) { - var permittedOptionsToReturn = ghostBookshelf.Model.permittedOptions(methodName), + var permittedOptionsToReturn = ghostBookshelf.Model.permittedOptions.call(this, methodName), // whitelists for the `options` hash argument on methods, by method name. // these are the only options that can be passed to Bookshelf / Knex.