From db7d00a8dce2cc1f7b9d86192cde1f55dd57408b Mon Sep 17 00:00:00 2001 From: Penar Musaraj Date: Wed, 18 Dec 2019 12:52:31 -0500 Subject: [PATCH] DEV: Log deprecated FA 4.7 icon names in /logs (take 2) Does not use utilities library, to avoid wizard qunit test failures --- .../discourse-common/lib/icon-library.js.es6 | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/assets/javascripts/discourse-common/lib/icon-library.js.es6 b/app/assets/javascripts/discourse-common/lib/icon-library.js.es6 index f0188fb2c5..70e1ab152c 100644 --- a/app/assets/javascripts/discourse-common/lib/icon-library.js.es6 +++ b/app/assets/javascripts/discourse-common/lib/icon-library.js.es6 @@ -584,6 +584,18 @@ function warnIfDeprecated(oldId, newId) { deprecated( `Please replace all occurrences of "${oldId}"" with "${newId}". FontAwesome 4.7 icon names are now deprecated and will be removed in the next release.` ); + if (!Discourse.testing) { + const errorData = { + message: `FA icon deprecation: replace "${oldId}"" with "${newId}".`, + stacktrace: Error().stack + }; + + Ember.$.ajax(`${Discourse.BaseUri}/logs/report_js_error`, { + errorData, + type: "POST", + cache: false + }); + } } function handleIconId(icon) {