Revert "FIX: removes part of the 2.4 legacy code forgotten (#87)"

Revert “FIX: removes part of the 2.4 legacy code forgotten (#87)”

This reverts commit c27d5f8e859cb80fda997db3ce2be2f0d0ce345f.

diff --git a/assets/javascripts/discourse/components/ad-component.js.es6 b/assets/javascripts/discourse/components/ad-component.js.es6
index 90775ce..40b9be2 100644
--- a/assets/javascripts/discourse/components/ad-component.js.es6
+++ b/assets/javascripts/discourse/components/ad-component.js.es6
@@ -51,10 +51,19 @@ export default Ember.Component.extend({
       return true;
     }
 
-    let noAdsGroups = this.siteSettings.no_ads_for_groups
-      .split("|")
-      .filter(Boolean);
-    let currentGroups = groups.map(g => g.id.toString());
+    let noAdsGroups = this.siteSettings.no_ads_for_groups.split("|");
+
+    // TODO: Remove when 2.4 becomes the new stable. This is for backwards compatibility.
+    const groupListUseIDs = this.site.group_list_use_ids;
+
+    let currentGroups = groups;
+    if (groupListUseIDs) {
+      currentGroups = currentGroups.map(g => g.id.toString());
+    } else {
+      currentGroups = currentGroups.map(g => g.name.toLowerCase());
+      noAdsGroups = noAdsGroups.map(g => g.toLowerCase());
+    }
+
     return !currentGroups.any(g => noAdsGroups.includes(g));
   },
 

GitHub sha: db4f5f99

1 Like

@jjaffeux I reverted this so the build could pass, please have a look when you get a chance, maybe these tests are no longer useful?

Ok that should fix it thanks:

2 Likes