From 5fc80968c62a5bca675e154dfb1e22d43493f09c Mon Sep 17 00:00:00 2001 From: Florian Maunier Date: Mon, 13 Jan 2025 16:19:45 +0100 Subject: [PATCH] fix(plugin): fix allowAdditionalActionProperties config accessing The default config is not merged in at the time this function is first called so we manually fallback on the default config --- lib/core/plugin/plugin.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/core/plugin/plugin.js b/lib/core/plugin/plugin.js index 59f2707ec2..4f40909e2a 100644 --- a/lib/core/plugin/plugin.js +++ b/lib/core/plugin/plugin.js @@ -31,6 +31,7 @@ const kerror = require("../../kerror"); const errorCodes = require("../../kerror/codes"); const Manifest = require("./pluginManifest"); const { has, isPlainObject } = require("../../util/safeObject"); +const defaultConfig = require("../../config/default.config"); const assertionError = kerror.wrap("plugin", "assert"); const runtimeError = kerror.wrap("plugin", "runtime"); @@ -334,8 +335,9 @@ class Plugin { definition.actions, )) { if ( - !global.app.config.content.controllers.definition - .allowAdditionalActionProperties + !global.app.config.content.controllers?.definition + ?.allowAdditionalActionProperties ?? + defaultConfig.controllers.definition.allowAdditionalActionProperties ) { const actionProperties = Object.keys(actionDefinition).filter( (prop) => prop !== "handler" && prop !== "http",