#  Estensione del moderatore

**URL:** https://meta.discourse.org/t/moderator-extension/67305
**Category:** Plugin
**Tags:** deprecated
**Created:** [2 Agosto 2017, 10:15am UTC](https://meta.discourse.org/t/moderator-extension/67305 "2017-08-02T10:15:17Z")
**Posts on this page:** 20
**Page:** 2

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [5 Aprile 2018, 5:20am UTC](https://meta.discourse.org/t/moderator-extension/67305/23 "2018-04-05T05:20:05Z")

</div>

@Flower_Child Upgrade the plugin and give it another go.

[https://github.com/angusmcleod/discourse-moderator-extension/commit/8b620f513f7d57cb81fa7fe2b0148fe2ea4f1901](https://github.com/angusmcleod/discourse-moderator-extension/commit/8b620f513f7d57cb81fa7fe2b0148fe2ea4f1901)

---

<div class="post-metadata">

### Author: ![Flower\_Child](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/flower_child/32/94987_2.png) [@Flower\_Child](https://meta.discourse.org/u/Flower_Child)
#### Post date: [5 Aprile 2018, 6:04am UTC](https://meta.discourse.org/t/moderator-extension/67305/24 "2018-04-05T06:04:09Z")

</div>

Looks like it’s partly fixed! The moderators now appear in categories without a page reload, but when returning to the index from a category, the moderators of the last category viewed still show up on the index for me.

My site uses category view on the index as the default tab, if that’s relevant.

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [5 Aprile 2018, 6:36am UTC](https://meta.discourse.org/t/moderator-extension/67305/25 "2018-04-05T06:36:56Z")

</div>

> [@Flower\_Child](#):
>
> The moderators now appear in categories without a page reload

Yeah, I pushed a fix for it a little after the first fix. Are you running this commit?

[https://github.com/angusmcleod/discourse-moderator-extension/commit/d00b18d5bade73f1c1b79799fcaf7da69480a821](https://github.com/angusmcleod/discourse-moderator-extension/commit/d00b18d5bade73f1c1b79799fcaf7da69480a821)

---

<div class="post-metadata">

### Author: ![Flower\_Child](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/flower_child/32/94987_2.png) [@Flower\_Child](https://meta.discourse.org/u/Flower_Child)
#### Post date: [5 Aprile 2018, 6:46am UTC](https://meta.discourse.org/t/moderator-extension/67305/26 "2018-04-05T06:46:51Z")

</div>

Yup, I even rebuilt the container to make sure I was fully updated and it still happens.

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [5 Aprile 2018, 7:31am UTC](https://meta.discourse.org/t/moderator-extension/67305/27 "2018-04-05T07:31:18Z")

</div>

Yup you were right, it’s because of that categories page 🙂

This should do it:

[https://github.com/angusmcleod/discourse-moderator-extension/commit/69788871c806b4a8b7921ee29072448e6370511d](https://github.com/angusmcleod/discourse-moderator-extension/commit/69788871c806b4a8b7921ee29072448e6370511d)

---

<div class="post-metadata">

### Author: ![Flower\_Child](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/flower_child/32/94987_2.png) [@Flower\_Child](https://meta.discourse.org/u/Flower_Child)
#### Post date: [5 Aprile 2018, 9:04am UTC](https://meta.discourse.org/t/moderator-extension/67305/28 "2018-04-05T09:04:38Z")

</div>

Ahah that fixed it. Thank you for all the help! 😄

---

<div class="post-metadata">

### Author: ![Heather\_Dudley](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/heather_dudley/32/151925_2.png) [@Heather\_Dudley](https://meta.discourse.org/u/Heather_Dudley)
#### Post date: [9 Aprile 2018, 6:14pm UTC](https://meta.discourse.org/t/moderator-extension/67305/29 "2018-04-09T18:14:13Z")

</div>

@angus I’ve created that account (And posted in one of the mod categories) so can can find me easily.

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [11 Aprile 2018, 8:27am UTC](https://meta.discourse.org/t/moderator-extension/67305/31 "2018-04-11T08:27:29Z")

</div>

Thanks @Heather_Dudley 👍 I did get a chance to test it with some other folks then. This plugin has moved on a bit since that initial test. Have you had a chance to try it out on your site yet? It should be ready to go.

---

<div class="post-metadata">

### Author: ![Heather\_Dudley](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/heather_dudley/32/151925_2.png) [@Heather\_Dudley](https://meta.discourse.org/u/Heather_Dudley)
#### Post date: [23 Maggio 2018, 3:46pm UTC](https://meta.discourse.org/t/moderator-extension/67305/32 "2018-05-23T15:46:10Z")

</div>

Sorry for the delay! I’ve asked our dev to this plugin and I’ll give it a good test run once he does! I appreciate the time you’ve taken to develop this!

---

<div class="post-metadata">

### Author: ![Flower\_Child](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/flower_child/32/94987_2.png) [@Flower\_Child](https://meta.discourse.org/u/Flower_Child)
#### Post date: [1 Giugno 2018, 7:26am UTC](https://meta.discourse.org/t/moderator-extension/67305/33 "2018-06-01T07:26:08Z")

</div>

has anyone observed a bug “infinite rendering invalidation detected”  
it seems to happen in random categories when “Show a list of moderators assigned” is enabled. when you first open the category, everything appears normal, except the moderator icons don’t appear on the widget. if you enter a thread and then go back to the thread list, or refresh the page, it loads forever (or loads the header and page content up until the “Moderators” text and then nothing below).

`
Uncaught Error: infinite rendering invalidation detected
Url: https://www.safarizone.net/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js
Line: 10
Column: 6276
Window Location: https://www.safarizone.net/c/chill-out`

```plaintext
Error: infinite rendering invalidation detected
    at Array.d (https://www.safarizone.net/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:10:6301)
    at p._trigger (https://www.safarizone.net/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:7:21198)
    at p.end (https://www.safarizone.net/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:7:21074)
    at p.run (https://www.safarizone.net/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:7:22011)
    at p.join (https://www.safarizone.net/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:7:22135)
    at Array.d (https://www.safarizone.net/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:10:6368)
    at p._trigger (https://www.safarizone.net/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:7:21198)
    at p.end (https://www.safarizone.net/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:7:21074)
    at p.run (https://www.safarizone.net/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:7:22011)
    at p.join (https://www.safarizone.net/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:7:22135)

```

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [2 Giugno 2018, 7:12am UTC](https://meta.discourse.org/t/moderator-extension/67305/34 "2018-06-02T07:12:41Z")

</div>

I’m currently travelling. I’ll take a look at this next week.

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [5 Giugno 2018, 12:20am UTC](https://meta.discourse.org/t/moderator-extension/67305/36 "2018-06-05T00:20:50Z")

</div>

> [@Flower\_Child](#):
>
> has anyone observed a bug “infinite rendering invalidation detected”

I’m not 100% sure why you’re seeing this as I can’t repro it, but I’ve improved the relevant code in various ways. If you could try enabling it again and let me know how it goes.

[https://github.com/angusmcleod/discourse-moderator-extension/commit/2fd2973de1789edc6b34969fd6279e5573b4c0aa](https://github.com/angusmcleod/discourse-moderator-extension/commit/2fd2973de1789edc6b34969fd6279e5573b4c0aa)

---

<div class="post-metadata">

### Author: ![Flower\_Child](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/flower_child/32/94987_2.png) [@Flower\_Child](https://meta.discourse.org/u/Flower_Child)
#### Post date: [5 Giugno 2018, 12:56am UTC](https://meta.discourse.org/t/moderator-extension/67305/37 "2018-06-05T00:56:00Z")

</div>

interesting.. now for the affected categories it no longer breaks the page or causes an infinite rendering bug, but the moderator icons don’t display. the text does, but no icons.

I triple checked to make sure there are mods assigned to that category, tried removing and adding them back, etc, but no luck. I also have no clue why this only seems to apply to one particular category.

This is in the console now:

```plaintext
TypeError: Cannot read property 'username' of null
    at _plugin-third-party-14149fdb39b7ab1f2e6bffc149f051bd0c9b6003b0e6d3cf7f39a571aa228510.js:9390
    at Array.map (<anonymous>)
    at s.moderators (_plugin-third-party-14149fdb39b7ab1f2e6bffc149f051bd0c9b6003b0e6d3cf7f39a571aa228510.js:9389)
    at s.<anonymous> (_application-3f35beee529621978637f7f58174f3479eb8fb739071c410b5d5ce00e3f94877.js:83)
    at l.f.get (_ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:28958)
    at Object.r [as get] (_ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:33686)
    at t.compute (_ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:27023)
    at t.value (_ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:26898)
    at e.iterate (_ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:26662)
    at e.isEmpty (_ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:11199)
```

Clicking the top file in the stack trace it looks like it’s this bit that’s causing at least that particular problem.

```plaintext
moderators: function moderators(_moderators) {
      if (!_moderators) return [];
      return _moderators.map(function (m) {
        Ember.set(m, 'url', (0, _url.userPath)(m.username));
        return m;
      });
    },
```

---

<div class="post-metadata">

### Author: ![Flower\_Child](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/flower_child/32/94987_2.png) [@Flower\_Child](https://meta.discourse.org/u/Flower_Child)
#### Post date: [5 Giugno 2018, 12:58am UTC](https://meta.discourse.org/t/moderator-extension/67305/38 "2018-06-05T00:58:18Z")

</div>

oh also erm, i think whatever you did in that update also reverted the issue i mentioned before in this topic haha. going to a category and then to the categories page (my site’s index) makes the Moderators text (and icons, for categories where the ^ bug isn’t occurring) appear on the index until a page reload

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [5 Giugno 2018, 1:32am UTC](https://meta.discourse.org/t/moderator-extension/67305/39 "2018-06-05T01:32:50Z")

</div>

> [@Flower\_Child](#):
>
> going to a category and then to the categories page (my site’s index) makes the Moderators text (and icons

This should be fixed (again).

[https://github.com/angusmcleod/discourse-moderator-extension/commit/3b0752cae19697c159524d00bd1e11d8e95976c5](https://github.com/angusmcleod/discourse-moderator-extension/commit/3b0752cae19697c159524d00bd1e11d8e95976c5)

> [@Flower\_Child](#):
>
> now for the affected categories it no longer breaks the page or causes an infinite rendering bug, but the moderator icons don’t display  
> …  
> I also have no clue why this only seems to apply to one particular category.

It sounds like you have some invalid data saved in the custom\_field for that category. Try it again with this update.

[https://github.com/angusmcleod/discourse-moderator-extension/commit/30995654d3c77ebd8e38718041cab506704ef5da](https://github.com/angusmcleod/discourse-moderator-extension/commit/30995654d3c77ebd8e38718041cab506704ef5da)

Thanks for your patience!

---

<div class="post-metadata">

### Author: ![Flower\_Child](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/flower_child/32/94987_2.png) [@Flower\_Child](https://meta.discourse.org/u/Flower_Child)
#### Post date: [5 Giugno 2018, 1:40am UTC](https://meta.discourse.org/t/moderator-extension/67305/40 "2018-06-05T01:40:50Z")

</div>

looks to be fixed, thank you for all the help!

---

<div class="post-metadata">

### Author: ![davidkingham](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/davidkingham/32/119528_2.png) [@davidkingham](https://meta.discourse.org/u/davidkingham)
#### Post date: [26 Agosto 2018, 2:23pm UTC](https://meta.discourse.org/t/moderator-extension/67305/41 "2018-08-26T14:23:32Z")

</div>

Hi Angus, my list of moderators seems to be hit and miss. For example [this category](https://community.naturephotographers.network/c/landscape/landscape-gallery) has three mods but only one shows up. [This one](https://community.naturephotographers.network/c/wildlife/wildlife-gallery) shows correct with three mods, [this one](https://community.naturephotographers.network/c/everything-else/photo-art) shows no mods but there there should be one. Any idea what’s going on here?

---

<div class="post-metadata">

### Author: ![davidkingham](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/davidkingham/32/119528_2.png) [@davidkingham](https://meta.discourse.org/u/davidkingham)
#### Post date: [29 Agosto 2018, 1:33pm UTC](https://meta.discourse.org/t/moderator-extension/67305/42 "2018-08-29T13:33:47Z")

</div>

@angus I also now have incorrect moderators showing in the list. The user I have set to [this category’s](https://community.naturephotographers.network/c/avian/avian-critiques) name is [Keith](https://community.naturephotographers.network/u/keith_bauer/summary), but it is showing this [Keith](https://community.naturephotographers.network/u/keith/summary) instead.

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [29 Agosto 2018, 11:04pm UTC](https://meta.discourse.org/t/moderator-extension/67305/43 "2018-08-29T23:04:43Z")

</div>

I’ll take a look today @davidkingham. Just to clarify, is it just the list displayed in the category that is incorrect? Do the category moderator assignments appear correctly in admin/users?

---

<div class="post-metadata">

### Author: ![davidkingham](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/davidkingham/32/119528_2.png) [@davidkingham](https://meta.discourse.org/u/davidkingham)
#### Post date: [29 Agosto 2018, 11:30pm UTC](https://meta.discourse.org/t/moderator-extension/67305/44 "2018-08-29T23:30:45Z")

</div>

Correct, just in this list. Hopefully you saw my post above this as well. Thanks Angus!

![image](https://global.discourse-cdn.com/meta/original/3X/5/1/51bb78515cc7b390cbb78d80bbd15d4c6b5af12f.png)

[Pagina precedente](https://meta.discourse.org/t/moderator-extension/67305.md?page=1)

[Pagina seguente](https://meta.discourse.org/t/moderator-extension/67305.md?page=3)
