From 824878f3152803ff405030fe3ac9f960869a1f8e Mon Sep 17 00:00:00 2001 From: David Taylor Date: Mon, 27 Nov 2023 13:43:02 +0000 Subject: [PATCH] DEV: Prepare plugin-outlet for ember upgrade (#24567) In modern versions of Ember, `this.parentView` is called internally during component init. We don't want our deprecation message to be triggered by that internal call, so we need an additional check. Extracted from https://github.com/discourse/discourse/pull/21720 --- .../javascripts/discourse/app/components/plugin-outlet.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/app/components/plugin-outlet.js b/app/assets/javascripts/discourse/app/components/plugin-outlet.js index 05f2a6d8295..5c621d18e10 100644 --- a/app/assets/javascripts/discourse/app/components/plugin-outlet.js +++ b/app/assets/javascripts/discourse/app/components/plugin-outlet.js @@ -145,7 +145,11 @@ class PluginOutletWithTagNameWrapper extends ClassicComponent { // Overridden parentView to make this wrapper 'transparent' // Calling this will trigger the deprecation notice in PluginOutletComponent get parentView() { - return this._parentView.parentView; + // init() of CoreView calls `this.parentView`. That would trigger the deprecation notice, + // so skip it until this component is initialized. + if (this._state) { + return this._parentView.parentView; + } } set parentView(value) { this._parentView = value;