Moderator Extension

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:

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.

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

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

This should be fixed (again).

https://github.com/angusmcleod/discourse-moderator-extension/commit/3b0752cae19697c159524d00bd1e11d8e95976c5

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

Thanks for your patience!

2 Likes

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

1 Like

Hi Angus, my list of moderators seems to be hit and miss. For example this category has three mods but only one shows up. This one shows correct with three mods, this one shows no mods but there there should be one. Any idea what’s going on here?

@angus I also now have incorrect moderators showing in the list. The user I have set to this category’s name is Keith, but it is showing this Keith instead.

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?

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

image

On another note, would it be possible to move the moderators below the featured images to keep the moderator list next to whos online? Thank you Angus.

3 Likes

Sure. Remind me in our pm thread tomorrow and I’ll do it.

Is there a specific i18n string for “Moderators”? “Your hosts” would look so much friendlier to me. Thanks!

Yup, it’s category.moderators. You can edit this in Customize > Text Content.

1 Like

Can i move the moderators in the description section ? just like this:

Hey @angus a big heads up here: the Review Queue is unfortunately going to have breaking changes for discourse-moderator-extension and discourse-category-moderator-lite since it removes QueuedPost.

I am working on backwards compatibility right now, and while some internal APIs can be preserved, the prepending of modules to QueuedPost and QueuedPostController will not work as I can’t cover the entire thing.

The good news is the Review Queue is meant to allow group specific moderation, so it’s likely the core functionality will meet your needs or be much easier to customize for them.

The feature is not ready for primetime, so I’m hoping with enough notice you’ll have a chance to review the changes coming to core to minimize interruptions.

13 Likes

Many thanks for the heads up Robin. I’ll check it out next week.

3 Likes

I think the changes have broken the plugin…

https://github.com/angusmcleod/discourse-moderator-extension/issues/1

6 Likes

Hey @jonathon, thanks for reporting!

I had been following the development of new Review Queue (after @eviltrout helpfully gave me a heads up), however I just went on holiday (got back Monday) and wasn’t able to get to this one in the busy build up to going away.

I’ve slotted in time to work on the upgrade to this on Friday. I’m using a new system for my open source Discourse work, to give a bit more visibility on what I’m working on and when (a “Work” category paired with my Events Plugin).

https://discourse.angusmcleod.com.au/t/update-the-moderator-extension-plugin/827

Considering the extent of the changes, I may not be able to finish the upgrade in one sitting. If not I’ll schedule another time to take a look at this.

In the meantime, this means that this plugin only supports up to https://github.com/discourse/discourse/releases/tag/v2.3.0.beta5

See: https://discourse.angusmcleod.com.au/c/modext

Screenshot%20at%20Apr%2003%2013-26-00

6 Likes

Given the current work at Discourse related to Category-Specific Moderators, phase 1 RFC, do you think this is going to be superceded and/or integrated in some official Discourse plugin?

2 Likes

Yes, I very much hope it will soon be superseded! :slight_smile:

4 Likes

I hope so, this is special usefull when you would like to run a multi-lingual site an Jail a moderator to specific language (category)…

Q.- Can you assigned the same moderator to more than one category?

Regards.,

2 Likes