Topic on Extension talk:CommentStreams

Star Warden (talkcontribs)

Thank you for implementing comment moderation. It's a feature we've all been waiting for!

Is it possible to give anonymous users the right to comment? If it exists, I don't see/know how to enable it. And would it be possible to hide the deletion of comments in the Recent Changes?

Cindy.cicalese (talkcontribs)

Thank you for your suggestions! No, there is currently no way to comment anonymously. I will investigate adding that as an option as well as suppressing events from Recent Changes. Would you want only deletion suppressed or creation and editing of comments as well? I have added tasks for those features here: https://phabricator.wikimedia.org/project/board/2820/. Honestly, I don't know when I'll have time to get to implementing them, but I will try.

Please feel free to let me know if you have any additional feature requests or any bug reports.

Thanks,

Cindy

Star Warden (talkcontribs)

Hey. Thanks for the reply.

Well, it would be nice if we had an option to hide any kind of CS-related notification in the recent changes. Would it also be possible to have a log of comments? Maybe under Special:log/commentstreams or something? It would really help with moderation in the absence of notices on the RC and it would also keep the RC clutter-free.

I've also noticed that all comments get categorised under Pages with ignored display titles automatically. Maybe this should be mentioned in the extension's description?

Cindy.cicalese (talkcontribs)

Yes, a special page with a list of comments would be a good thing.

I have not seen a Pages with ignored display titles category. Which version of MediaWiki are you using? Do you have the following settings?

$wgAllowDisplayTitle = true;
$wgRestrictDisplayTitle = false;

I realize that those are missing from the documentation. I will need to add them.

Star Warden (talkcontribs)

Hey. No, I don't have those in my localsettings. I am using MW 1.28.2.

Cindy.cicalese (talkcontribs)

Could you please add those to your LocalSettings.php and tell me if the category goes away? Thanks! If it does go away, I could add a check to the CommentStreams code not to bother to set the display title if $wgAllowDisplayTitle is not set.

Star Warden (talkcontribs)

I disabled that tracking category through adding a dash to MediaWiki:Restricted-displaytitle-ignored and also deleted the category itself some time ago. I have undeleted the category and even removed the dash from that MediaWiki message now in order to add those to local settings, but the category still appears disabled in Special:TrackingCategories and under the category itself, there are no pages. I have even run refreshLinks and updateSpecialPages, but it just won't get reenabled. I know of no other way of reenabling the category and Help:Tracking categories doesn't offer much information either.

Cindy.cicalese (talkcontribs)

Ah, I found the patch where the tracking category was added in MW 1.28: https://gerrit.wikimedia.org/r/#/c/290071/. It does only appear to affect wikis with $wgRestrictDisplayTitle = true;. I'm glad you were able to disable it, nonetheless, although it is odd that you couldn't re-enable it.

Star Warden (talkcontribs)

Hi. Any word on anonymous commenting?

Cindy.cicalese (talkcontribs)

No, not at this point. I recently changed jobs and am now maintaining this on my own time. Can you give me a sense of how critical the need for this feature is so I can prioritize it? I think it can be added without a significant amount of work, but I need to find time to work on it.

Star Warden (talkcontribs)

I would say very important, at least for our wiki. We want to have all people, regardless of their anonymity, interact with one another in the comments, because that's our vision on our community. As a matter of fact, it's so important that it's basically the only thing keeping us from not installing your extension.

And I am not saying it as a critique to your extension or to yourself. The extension is incredibly well-made and useful, plus you have no obligations towards me, I am just happy that such an extension exists. I was just highlighting the sense of importance (for us) for anonymous to be able to comment.

Thank you for the answer!

Cindy.cicalese (talkcontribs)

Thank you so much for the feedback! Actually, I was sort of hoping that would be your answer, because I would love to see the extension be used this way. Since this is a showstopper for you, I will bump this up in my queue.

Just to confirm the expected functionality, I'm assuming it's OK with you that anonymous users will not be able to edit or delete their comments once they have submitted them. I will plan to put up a warning dialog reminding them of that fact when they click submit. Moderators, or course, will still be able to delete and, optionally, edit anonymous comments. Also, would you expect anonymous comments to have "anonymous" (maybe in a different color) in the area where the user's name would otherwise be? Should the IP address be displayed, or would that defeat the purpose of anonymity? The IP address would still be captured in the page history for the page in the CommentStreams namespace containing the actual comment text.

Star Warden (talkcontribs)

Hey. Thanks for the inquiry. I'd really like the anonymous colour thing. And yes, basically, hiding their IP from regular users is the best thing, even if they show up in the history.

As for editing comments. Couldn't that be an on-off feature? Maybe even have the option to allow only certain groups to edit their comments? And, going even further, maybe have an 'edit history' similar to facebook's. Of course, if it's too much work, I am happy with what you suggested. As long as anonymous are able to comment, it's all great on my side!

Cindy.cicalese (talkcontribs)

To clarify about editing comments, I don't think you're saying that the author of an anonymous comment should be able to edit it, correct? That would be problematic, since there would be no safe way of making sure that the editor is the same as the author because of anonymity. The only thing that can be verified is the IP address, which is not a reliable indication of identity.

Instead, what we're discussing is the ability of a logged in user to edit an anonymous comment. That can be done by moderators. The reason I said "optionally" is that by default, moderators are able to delete comments but not edit them. If you want a moderator to be able to edit comments as well, you need to set:

$wgGroupPermissions['csmoderator']['cs-moderator-edit'] = true;

Setting up arbitrary groups (other than moderators) who could edit each other's comments would be difficult to implement.

There is indeed already an edit history on all comments, since comments themselves are stored on wiki pages. The interface is currently not too elegant, since you'd need to find and navigate to the comment's page, but the information is available. If that becomes a high priority feature request, an easier way to view comment history could potentially be developed on top of the already existing retained history.

So, in summary, I will try to find the time to add the ability to post anonymous comments. All other features (the ability of moderators to edit and delete anonymous comments and viewing comment history) should work without change.

Thank you for helping me to think through the design of this feature.

Star Warden (talkcontribs)

Now that you put it this way, I didn't think of the downside of anonymous editing their comment. But moderators editing comments is perfectly fine.

I will be awaiting the next version. Thank you!

Cindy.cicalese (talkcontribs)

I have a patch pending with anonymous commenting. Please test https://gerrit.wikimedia.org/r/#/c/376912/ and let me know if it works for you. You will need to set

$wgCommentStreamsAllowAnonymousComments = true;

Note that, since comments are stored as wiki pages, in order to allow anonymous commenting, your wiki must be editable by anonymous users with

$wgGroupPermissions['*']['edit'] = true;

Other namespaces can be protected using $wgNamespaceProtection as long as the CommentStreams namespace is editable by anonymous users. (I am considering adding a separate 'comment' permission to allow a wiki to be closed for anonymous editing but open for anonymous comments, but that would require additional configuration using $wgGroupPermissions even, perhaps, in the default case. Thoughts?)

Feedback welcome.

Star Warden (talkcontribs)

Do I just download the master version through git or are there additional steps I need to do? I haven't tested a gerrit patch before, so I am not sure how to proceed.

The wiki does allow anonymous editing, it doesn't allow anonymous page creation (except talk pages). But it would be great if anonymous commenting didn't depend on editing permissions.

Cindy.cicalese (talkcontribs)

To test, clone the extension from git, then from the CommentStreams directory do:

git fetch https://gerrit.wikimedia.org/r/mediawiki/extensions/CommentStreams refs/changes/12/376912/6 && git checkout FETCH_HEAD

You can find that command in the future by visiting the patch page on gerrit (e.g. https://gerrit.wikimedia.org/r/#/c/376912/) and looking for the Download link all the way to the right on the top gray bar.

I have changed it so that there is now a "cs-comment" right. To allow anonymous commenting, set:

$wgGroupPermissions['*']['cs-comment'] = true;

I removed the now unnecessary $wgCommentStreamsAllowAnonymousComments configuration flag. To retain backward compatibility and simplify configuration, if the "cs-comment" right is not set for any groups, it defaults to be allowed for the same groups as the "edit" right.

Star Warden (talkcontribs)

Unfortunately, I receive HTTP 500 Error. I have downloaded the 1.29 version then applied the patch above then ran update.php. Then I removed the 1.29 version and downloaded the master version, applied the above patch and ran the same script. Am I doing something wrong?

Cindy.cicalese (talkcontribs)

Can you check the web server log to see what is causing the 500? Or turn on MediaWiki debugging (Manual:How to debug) to get more information. My favorite debug settings are:

error_reporting( -1 );

ini_set( 'display_errors', 1 );

$wgResourceLoaderDebug = true;

$wgShowDBErrorBacktrace = true;

$wgDebugLogFile= "/tmp/MediaWikiDebug.log";

Star Warden (talkcontribs)

Ah, sorry. I completely forgot about debugging (even though the comment stream line. was added just below the disabled debugging lines, whoops!)

This is the error I am getting: Fatal error: Call to undefined method Comment::getAssociatedComments() in /extensions/CommentStreams/includes/CommentStreams.php on line 138

Cindy.cicalese (talkcontribs)

That's very strange. Can you check Comment.php to see if that function (getAssociatedComments) is there? It should be at line 803. It sounds like something did not go well with the git clone/fetch/checkout.

Star Warden (talkcontribs)

It is there. This is the entirety of line 803: public static function getAssociatedComments( $assoc_page_id ) {

Cindy.cicalese (talkcontribs)

How about file permissions? Are all of the files readable by your web server?

Star Warden (talkcontribs)

It is. The entire wiki folder belongs to www-data. I even ran chown -R to the entire folder after downloading everything belonging to Comment Streams.

Cindy.cicalese (talkcontribs)

Could you inject a syntax error into Comment.php to make sure it is getting loaded? Do you use SELinux (which might require a restorecon).

Just to confirm the steps:

cd to your extensions directory

remove CommentStreams if it exists

git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/CommentStreams

cd CommentStreams

git fetch https://gerrit.wikimedia.org/r/mediawiki/extensions/CommentStreams refs/changes/12/376912/6 && git checkout FETCH_HEAD

Cindy.cicalese (talkcontribs)

The command above is for patch 6. There is now a patch 7 which bumps the version number of CommentStreams to 3.10. You could try that one and visit Special:Version to see whether it correctly reports 3.10. The command just swaps 7 for 6 as below:

git fetch https://gerrit.wikimedia.org/r/mediawiki/extensions/CommentStreams refs/changes/12/376912/7 && git checkout FETCH_HEAD

I should have asked sooner, but what are you doing when you get the 500? I'm assuming that you are viewing a regular page that can have comments on it.

Star Warden (talkcontribs)

It is 3.10 and yes, I was checking a page which allows commenting. And I am not sure what kind of syntax error I should introduce. I added some random numbers at the beginning of the line, reloaded the page and got the exact same error with debugging turned on. Then I commented out the line and got the exact same error, again. Without debugging turned on, I only get http 500.

Cindy.cicalese (talkcontribs)

It sounds to me like it is not successfully loading the Comment.php file. Do you have the same problem if you do the git clone but do not fetch the patch? Or is the problem only with the patch?

Adding random numbers is exactly the type of error I was thinking of. Since it did not generate an error, that file does not appear to be being used. To be even more sure, you could add:

die("some error message");

after the <?php.

The fact that you're seeing the correct version number seems to indicate that you are correctly getting the patch. Other than file permissions or SELinux, I can't think of a reason it would not be able to load that file.

Star Warden (talkcontribs)

The server is on ubuntu. And I get the exact same error when using the unpatched version.

Cindy.cicalese (talkcontribs)

I am running it successfully on debian, which should not be significantly different from ubuntu.

I had thought you had been able to run CommentStreams previously. It is helpful to know that it isn't only the patch. Then, there must be something off in your configuration.

Are you loading the extension with:

$wgGroupPermissions['*']['cs-comment'] = true;

wfLoadExtension( 'CommentStreams' );

Do you have any other CommentStreams configuration variables set? Are you loading other extensions? Do you see any other errors that might be contributing to the problem? You are running MediaWiki 1.29?

Cindy.cicalese (talkcontribs)

How do you normally install extensions? Using git? Or using Extension Distributor?

Star Warden (talkcontribs)

I am using git to install extensions and I am on MW 1.29 (this is the site: http://dragon-mania-legends-wiki.mobga.me/Main_Page). And I've added these lines at the end of local settings.php:

$wgGroupPermissions['*']['cs-comment'] = true; wfLoadExtension( 'CommentStreams' ); $wgAllowDisplayTitle = true; $wgRestrictDisplayTitle = false;

However, I found out what the problem was. The previous Comments extension had to be disabled. Now it's happening another weird thing. The comment area won't appear at the bottom of the pages.

Cindy.cicalese (talkcontribs)

That's progress!

When I load the page, I see a number of errors in the JavaScript console. Errors in other extensions loaded before CommentStreams could stop it from being run. I do notice that I do see it when I am in debug mode:

http://dragon-mania-legends-wiki.mobga.me/Main_Page?debug=true

I can try to add a comment, but then I get a database error. Usually that will happen when you have not run update.php or when it has not completed successfully.

Star Warden (talkcontribs)

Yeah, I am getting the same error, but I see nothing in the console. I turned debugging on, though.

Cindy.cicalese (talkcontribs)

It is getting a DB query error at line 657 of Comment.php. At that point, it is trying to select a row from the cs_watchlist table. Could you please check to see if that table exists? It should have been created by the update.php maintenance script.

Star Warden (talkcontribs)

That's weird. The table doesn't exist and I ran php update.php twice and it didn't create it.

Cindy.cicalese (talkcontribs)

What database are you using? The update script does correctly create the tables for me with MySQL and MariaDB. My guess, unless there is a database incompatibility, is that there is another extension that is causing the update script to fail to complete, but I could be wrong. You could try to run the scripts in the CommentStreams sql directory manually to create the tables.

Star Warden (talkcontribs)

The wiki is running MySQL 5.5.57-0ubuntu0.14.04.1. What scripts should I use?

Cindy.cicalese (talkcontribs)

There are three SQL scripts in the CommentStreams sql subdirectory. You could run all three of them They each create a table if the table does not already exist. You would run the scripts from mysql since they contain SQL code.

Star Warden (talkcontribs)

Good news! Indeed, the missing tables were the problem, but... they weren't missing. Somehow php update.php, when creating them, didn't add the prefix of the wiki database. They were simply cs_watch and cs_votes. I think it must be on your side, because I ran the queries and it gave me the same result. I just renamed those tables and everything works fine! Thank you!

Star Warden (talkcontribs)

Eee, I got happy too soon. I am getting this error when trying to access Special:AllComments (Fatal error: Call to a member function getTitle() on a non-object in /srv/dml-wiki/extensions/CommentStreams/includes/CommentStreamsAllComments.php on line 78).

Also, would it be possible to prevent comments from appearing on redirect pages and talk pages?

Cindy.cicalese (talkcontribs)

Oh! Yes, that is a problem on my end. I don't use prefixes, so I didn't have that problem. I will fix that soon.

I will look at the getTitle() error when I get a chance.

There is a flag to prevent comments from showing up on talk pages: $wgCommentStreamsEnableTalk. It should default to false, but it does not appear to be working. It does seem reasonable to disable comments on redirect pages. I will work on both of those soon as well.

I'm so glad you have made progress!

Star Warden (talkcontribs)

The thing is, the previous flag ($wgCommentStreamsAllowedNamespaces) specifies that "If comments are enabled on a subject namespace, they will automatically be enabled on the corresponding talk namespace as well."

Also, would it be possible to make the 'add comment' button larger. Or even have an option where we can enter our own text next to it. Like, for example, I'd like to have 'ADD YOUR COMMENT' next to the button. And, also, to choose a custom time format for the timestamp of the comments?

Star Warden (talkcontribs)

Hey again. It seems that there is a weird issue going on. If I try to access some comments from the commentstream log, they will just show as empty (http://dragon-mania-legends-wiki.mobga.me/index.php?title=Special%3ALog&type=commentstreams&user=&page=&year=&month=-1&tagfilter=&hide_thanks_log=1&hide_chat_log=1&hide_privatechat_log=0&hide_patrol_log=1&hide_tag_log=1).

Additionally, some users reported they weren't seeing comments on a page where I was seeing them. For example, a user said they couldn't see this comment: http://dragon-mania-legends-wiki.mobga.me/Wisdom_of_the_Ancients#cs-comment-20012

Cindy.cicalese (talkcontribs)

I just merged a patch that fixed a problem (JavaScript syntax errors) that was affecting IE. Although it was not reported as affecting other browsers, perhaps it caused a conflict with your other JavaScript extensions. I did notice the missing comments on your site but have not been able to reproduce elsewhere. Oddly, if I acc "&debug=true" to the URL to enable debugging, the comments appear. Either way, no errors are shown in the browser JavaScript console.

Cindy.cicalese (talkcontribs)

I see what you're saying about talk page comments. You are correct. It is behaving the way it was designed. Comments are always enabled on talk pages for which comments are enabled in the corresponding subject namespace. The $wgCommentStreamsEnableTalk variable enables comments on all talk pages. There is no corresponding way to disable comments on all talk pages. I would rather not make the configuration any more complicated than it already is. Is disabling comments on all talk pages a "nice to have" or a "need to have"?

The patch has been updated to suppress comments on redirect pages, fix the fatal error on Special:AllComments, and fix the missing prefix problem for the database tables.

The buttons can be made larger with CSS (which can be added on the MediaWiki:Custom.css page). For example:

.cs-button img {
    width:40px;
    height:40px;
}

Could you please re-test?

Cindy.cicalese (talkcontribs)

Regarding optional text beside the buttons, I may add that after this patch is merged.

Cindy.cicalese (talkcontribs)

I went ahead and merged the anonymous commenting patch as well as the bug fixes discussed above. If you encounter any issues, please let me know.

Star Warden (talkcontribs)

Hey. So I downloaded the recent patch (git fetch https://gerrit.wikimedia.org/r/mediawiki/extensions/CommentStreams refs/changes/12/376912/14 && git checkout FETCH_HEAD) and indeed now I can access AllComments, but oddly enough, only two are shown there...

Could the cause for the other comments not appearing be that 'restricted-display-title' category is disabled? (http://dragon-mania-legends-wiki.mobga.me/Special:TrackingCategories). Earlier on this thread I posted about re-enabling it to test something you asked me to, but it just wouldn't get reenabled. I mean, I don't find it necessary, I am just wondering if it could be the cause for the missing comments. Also, debugging is currently turned off in localsettings, but I can turn it on if it helps.

Regarding comments on talk pages, I would say it's a mix of both. It would cause confusion if people use two commenting systems. Maybe have them disabled by default and have the option to enable them? Of course, it it's too complicated or takes too long, then it's no big of a deal.

Thanks!

Star Warden (talkcontribs)

I am also getting this weird error (Catchable fatal error: Argument 1 passed to MediaWiki\Linker\LinkRenderer::makeLink() must implement interface MediaWiki\Linker\LinkTarget, null given, called in /srv/dml-wiki/includes/widget/search/FullSearchResultWidget.php on line 144 and defined in /srv/dml-wiki/includes/linker/LinkRenderer.php on line 146) when trying to run these search queries on the wiki ("comment" and "comments) to find leftover comment tags from the previous extension.

It seems to be caused by the CommentStreams extensions because I no longer get that error if I disable it and I am able to run the queries just fine.

Cindy.cicalese (talkcontribs)

Regarding Special:AllComments, the fatal error was caused by comments that are associated with a page with an invalid page id. So, I don't display those comments in the list. Oddly, I can see at http://dragon-mania-legends-wiki.mobga.me/Special:AllPages?from=&to=&namespace=844 that you have 18 comments, but, as you said, http://dragon-mania-legends-wiki.mobga.me/Special:AllComments only shows 3. The rest are presumably being eliminated since they have invalid associated page ids. (I should probably display them with an error message rather than hiding them, but the situation *should* really never occur - but clearly it is.) When I click through the 18 pages listed on Special:AllPages, only the 3 that show up on Special:AllComments have content in them. Note that when displaying a comment page, it will also bail if the associated page id is invalid, so that would explain why nothing is showing up for those pages there, either. If you are comfortable poking through the database, you could check try looking at the cs_comment_data table ("select * from cs_comment_data;") and checking to see if assoc_page_id points to a valid page ("select * from page where page_id=ABC" where ABC is a value of assoc_page_id from cs_comment_data).

Of the 3 comments I do see, I only see the comment displayed on http://dragon-mania-legends-wiki.mobga.me/Update_3.2. The comments are not visible to me on http://dragon-mania-legends-wiki.mobga.me/Torch_Dragon or http://dragon-mania-legends-wiki.mobga.me/Wisdom_of_the_Ancients unless I add "?debug=true" to the end of the URL. My hunch is that another extension is interfering somehow, but there is nothing in the JavaScript log to indicate that.

I don't think that the problem has to do with the restricted-display-title category, which is showing up as disabled, but I could certainly be wrong.

My guess is that the search problem is related to the invalid associated page ids as well. In the search results, it attempts to replace the link to the comment page with a link to the page that the comment is on (the associated page). If the id is invalid, it will cause an error. I should add a check for an invalid page id there as well, which would make the error go away. Those pages would just not be correctly linked to a valid associated page.

Cindy.cicalese (talkcontribs)

Please try this patch which displays comments on Special:AllComments even if they have an invalid associated page id and checks for invalid associated page id before attempting to replace the link in search results: https://gerrit.wikimedia.org/r/#/c/379780/.

Star Warden (talkcontribs)

So.. the comments are indeed displayed now in allcomments, but some have weird errors next to them. I also see some comments that were deleted. The very first ones that were tests. Shouldn't they not be there?

Cindy.cicalese (talkcontribs)

Did you delete the page that those comments were on? Right now, when you delete a page, the comments on that page are not deleted, in case that page is restored in the future. But, maybe they need to be marked in some way at a minimum.

The pages with the red display title error should not be showing up that way. The display title tag stored in the wikitext should be getting stripped. It would be interesting to see what's stored in the database in the "text" table for one of those comments to see why the code to strip the display title isn't working.

Is it only old comments that this is not working for? Or do new comments get munged, too? I'm wondering if this is mess left around by previous versions - although some of the comments looks recent.

Cindy.cicalese (talkcontribs)

With respect to the database, this is what I see when I trace through the tables on my small test wiki. I'd be interested to compare that to what you're seeing for the broken comments. I query for all of the comments in the database. Then, I find the revisions for the first comment (page_id = 10). It has two revisions. I then find the text associated with the first revision (rev_text_id = 15). The "{{DISPLAYTITLE:...}}" stuff should get stripped out when the comment is displayed on Special:AllComments.

MariaDB [test]> select * from cs_comment_data;
+---------+---------------+----------------+------------------------------+
| page_id | assoc_page_id | parent_page_id | comment_title                |
+---------+---------------+----------------+------------------------------+
|      10 |             1 |           NULL | This is a comment            |
|      29 |             1 |           NULL | This is an anonymous comment |
|      30 |             1 |             29 | NULL                         |
|      40 |             1 |             10 | NULL                         |
+---------+---------------+----------------+------------------------------+
4 rows in set (0.00 sec)

MariaDB [test]> select rev_text_id from revision where rev_page=10;
+-------------+
| rev_text_id |
+-------------+
|          15 |
|          16 |
+-------------+
2 rows in set (0.00 sec)

MariaDB [test]> select old_text from text where old_id=15;
+-----------------------------------------------------------+
| old_text                                                  |
+-----------------------------------------------------------+
| This is comment text.{{DISPLAYTITLE:
This is a comment
}} |
+-----------------------------------------------------------+
1 row in set (0.00 sec)
Cindy.cicalese (talkcontribs)

Actually, you can use the page table rather than the revision table to find the latest revision:

MariaDB [test]> select page_latest from page where page_id=10;
+-------------+
| page_latest |
+-------------+
|          16 |
+-------------+
1 row in set (0.00 sec)

Star Warden (talkcontribs)

Cs_comment_data only has the last four comments inside it.

And those 'test' comments were actually deleted by myself. The page itself, where they were posted, is still there. I've only deleted the comments. It would be nice if delete comments (even if they were on a deleted page) were hidden from the public and only available to those who have the appropriate rights. In this case those with the right to delete comments.

Cindy.cicalese (talkcontribs)

Oh! Thank you! The problem is that Special:AllComments was getting the comments from the page table (which has all pages, whether they've been deleted or not) rather than the cs_comment_data table. I've merged a new patch that should fix that. You can pull it from master.

Star Warden (talkcontribs)
Cindy.cicalese (talkcontribs)

Thanks for pointing me to the error message. That is because of the database prefixes again. The database classes hide most of the details of that, but apparently they cannot handle explicit table references to disambiguate fields in where clauses. I'm going to have to rename the page_id column at a minimum, although I should probably prefix all of the column names. Patch coming . . . This one will involve a schema change, so it will need a major version bump.

Star Warden (talkcontribs)

Great! And is it possible to have deleted comments, on special:allcomments, be hidden from users without cs_delete rights? I mean, there is a reason why comments are deleted, so they shouldn't be accessible to regular users.

Cindy.cicalese (talkcontribs)

Deleted comments were only showing up since I was pulling comments from the page table, not the cs_comment_data table. Once the new patch works for you, you will no longer see deleted comments.

Star Warden (talkcontribs)

Ah, okay. But still, would it be possible to see them if you have the appropriate rights? It's a nice to have feature, so if it's too much work, then no problem if it's not implemented.

Cindy.cicalese (talkcontribs)

You can see deleted comments in the CommentStreams log at Special:Log. It isn't possible to hide things there, just as it isn't possible to hide deleted pages in Special:RecentChanges.

I think I have fixed the database table prefix/column prefix problem. Please check out https://gerrit.wikimedia.org/r/379968. It works for me, but I'd like you to test before I merge, since you have table prefixes. Thanks!

Cindy.cicalese (talkcontribs)

You will need to run the update.php maintenance script.

Star Warden (talkcontribs)

It's working now. Thanks! But what if the page itself gets deleted? The last two comments on special:allcomments belong to a deleted page. Couldn't those be hidden in some way and only reappear if the page gets restored?

Cindy.cicalese (talkcontribs)

Yes, those comments were originally hidden, but I unhid them when there were earlier issues, since it seemed you were missing comments. I have re-hidden them. Please try it now. In the future, I may need to create a moderator special page to show only the comments that are from deleted pages to allow gardening.

I'm also now seeing the two comments that do exist on their pages in your wiki, even without debug mode! Yay! I guess that problem had to do with the database prefixes, too.

Star Warden (talkcontribs)

It's perfect. Thank you!

Cindy.cicalese (talkcontribs)

OK, great! Thanks for your debugging help! I never would have found the table prefix problem without your testing.

I've made a small update to the patch to replace the IP address with "anonymous" on Special:AllComment. I'm going to merge the change now.

Cindy.cicalese (talkcontribs)

Merged! Feel free to check out version 4.0.

Star Warden (talkcontribs)

Awesome! And I am glad to have helped.

Regarding this change, would it be possible for users with the appropriate rights to see the IP of the anonymous? It's useful in cases where a particular user is being disruptive/trolling and they need to be blocked.

Star Warden (talkcontribs)

This is weird. I woke up to this: http://dragon-mania-legends-wiki.mobga.me/Special:AllComments I have no idea why it happened. The only thing I've done, the night before, was to restart the server and database, but that's all. Also, the comments, as well, that were on pages, have disappeared as well.

I know I deleted the bugged comments in the database so they wouldn't show up on the special: pages with prefixes, but that can't be the cause, could it? As I only deleted the bugged ones and not the good ones.

EDIT: I checked the database and it seems that even the good comments disappeared from the cs_comment table. I am not sure if, at this point, I accidentally deleted them or not, but now allcomments does show comments that were posted today. I won't touch the database from now and I'll monitor the comments to see if it was my fault or a bug in the extensions. Thanks!

LE: But could this message '⧼commentstreams-allcomments-nocommentsfound⧽' be a little user friendlier? Maybe something like 'There are no comments on this wiki' something.

Cindy.cicalese (talkcontribs)

I fixed the error message. The corresponding string was missing from the messages files.

Star Warden (talkcontribs)

Thanks!

Star Warden (talkcontribs)

In which file can I find the 'moderators (CommentStreams)' groups? I've given the moderation rights to the 'Moderators' group and I would like to remove the other one, but I can't find that one in any of the extension's files.

Cindy.cicalese (talkcontribs)

In i18n/en.json. Search for "group".

Star Warden (talkcontribs)

So... that got removed, but now the 'csmoderator' group is showing up and there aren't any other strings with the 'group' word in it. Where do I delete that from?

Cindy.cicalese (talkcontribs)

You could try lines 317 to 326 of CommentStreamsHooks.php.

Star Warden (talkcontribs)

Perfect. Thank you so much! Sorry for all the trouble.

Star Warden (talkcontribs)

Hey again. It seems that when deleting a comment, all comments get deleted. It happened last time as well, so I wasn't imagining it. I checked the database, but they're not there. What could cause this issue?

Cindy.cicalese (talkcontribs)

Sorry, just had a chance to look at this. I have not seen this behavior. Does it delete all comments whenever you delete a comment? Or only under some circumstances? If the latter, can you determine what those circumstances are or is it arbitrary?

Cindy.cicalese (talkcontribs)

When I look at http://dragon-mania-legends-wiki.mobga.me/index.php?title=Special%3ALog&type=commentstreams, I see 3 new comments that I can access and which are visible on http://dragon-mania-legends-wiki.mobga.me/Special:AllComments. I also see at the bottom of the log 4 comments that that have existing comment pages but do not appear in Special:AllComments. I'm assuming that these are comments on pages that were deleted, but I can't be sure. I should probably add a message on such comment pages to indicate this situation. Are these the comments that disappeared? Or are there other missing comments? I cannot replicate any behavior where I delete one comment and other get deleted except when I have $wgCommentStreamsModeratorFastDelete set and am deleting a whole comment thread.

Star Warden (talkcontribs)

Hey. The comments that were deleted were not part of a thread. Only those four are missing, yes. I think it happens whenever I delete a comment. It happened twice, so far, and I deleted two comments. And the thing is it disappears completely from the database, as well, so they cannot be restored either.

Cindy.cicalese (talkcontribs)

So, you deleted a comment on one page and an unrelated comment on another page was deleted? Or you deleted a comment on one page and all other comments on the wiki were deleted? I have not been able to reproduce either of those behaviors and don't see any obvious way in the code that could happen, but it could be that there's a bug in some case that I'm not hitting. It would really help to have more details about the situation. Thanks.

Star Warden (talkcontribs)
Cindy.cicalese (talkcontribs)

You can still see the comment pages as blue links on Special:Log/commentstreams. I just merged a patch this morning that will, if you click on the blue link to go to the comment page, still show the comment text.

Did you do a "select * from cs_comment_data" (with the appropriate table prefix for your site)? I'm wondering if they are still in there but pointing to an invalid page ID which would cause these symptoms. Then the question would be how the page ID is getting invalidated.

Cindy.cicalese (talkcontribs)

In other words, the comment pages themselves are clearly still there (blue links on Special:Log/commentstreams). So, one of two things has happened: 1) the data in cs_comment_data was somehow deleted OR 2) the data in cs_comment_data is still there but now points to an invalid page id. To clarify, cs_comment_data holds a mapping between the page that the comment text is saved on in the CommentStreams namespace and the page to which the comment refers (the page that the comment will be displayed at the bottom of). Figuring out which of those two things has happened will hopefully allow us to figure out what is causing the problem. According to the comment log, no comments have been (successfully) deleted since October 5. Looking at what is in cs_comment_data will help determine which of those two situations has occurred.

Star Warden (talkcontribs)

So I completely removed your extension and reinstalled it again. The cs_comment_table is completely empty: https://prnt.sc/

And if you check the comments from log/commentstreams you'll see it says they've been deleted, even though they weren't.

Cindy.cicalese (talkcontribs)

I'm sorry that you are experiencing these issues, and I hope we can get to the bottom of what is going on.

Did you check the contents of the table before removing/reinstalling? I don't think that would affect the table, but it depends on exactly how this was done.

The link you sent does not point to an image.

I recall that you use table prefixes, correct? Are you getting a table created as <prefix>cs_comment_data? And that table is now empty? And it is non-empty after you create a comment?

When I look at http://dragon-mania-legends-wiki.mobga.me/Special:Log/commentstreams, I do NOT see the comments all being deleted. I see 9 comments being created and on October 5 a single comment being deleted by a moderator. All of the comments except for the one that was deleted are live links; only the deleted comment is a red link. Where do you see on log/commentstreams that comments have been deleted?

However, just because the comment pages still exist does not mean that the data exists in cs_comment_data linking the comment page to the page on which the comment should appear. Figuring out what is going on in that table should be the key to solving this problem.

Star Warden (talkcontribs)

Hey. So very sorry for the late reply, but I had little to no access to internet the past days.

It seems that the issue has been resolved with the latest reinstall. If anything else occurs, I'll make a separate thread on this page because this one is way too long.

Thank you for all of your help!