Jump to content

Topic on Extension talk:CommentStreams

How to allow comments only on certain pages?

7
Summary by Cindy.cicalese

Fixed in version 8.0.0.

2601:280:4200:3B9:25A4:7D77:B7BA:3B3B (talkcontribs)

I did $wgCommentStreamsAllowedNamespaces = -1; and on pages I want the comment box I added <comment-streams />, but the comment box is not appearing.

Cindy.cicalese (talkcontribs)

Thank you for your question. I looked at the documentation, and it was outdated. I have updated it to correctly reflect the use of $wgCommentStreamsAllowedNamespaces. If you want to disable comments in all namespace but allow <comment-streams /> to enable comments on an individual page, you should set $wgCommentStreamsAllowedNamespaces to an empty array (i.e. $wgCommentStreamsAllowedNamespaces = [];) instead of -1.

Ludi81 (talkcontribs)

Hi, I tried to use $wgCommentStreamsAllowedNamespaces = []; but the comment is still enabled on all pages. I see the comment field, even if <comment-streams /> is not present on the current page.

Devaroo (talkcontribs)

Hey Cindy & Ludi81, same here, setting $wgCommentStreamsAllowedNamespaces = []; doesn't disable comments. As a workaround, I've only allowed one namespace that I'm not using – a dummy namespace, if you will. It works as expected, comments are enabled by default in that allowed namespace and disabled everywhere else. Inclusion through the comment-streams tag works, too. @Cindy.cicalese thanks for the great extension! Super useful and works like a charm :-)

Cindy.cicalese (talkcontribs)

I'm so sorry for the delay in responding to this. I did not have time to work on this extension for quite a while, but I'm now working on getting out a new release. I was able to confirm the reported behavior and have a patch at https://gerrit.wikimedia.org/r/c/mediawiki/extensions/CommentStreams/+/932024/. It should make it into the next release and will be backported the the REL1_39 and REL1_40 branches.

Devaroo (talkcontribs)

Hey Cindy, no worries! Nice to hear you were able to patch this, thanks for your effort :-)

Cindy.cicalese (talkcontribs)

You're welcome! I released version 8.0.0 with the fix two days ago.