edwardspec / mediawiki-moderation

Extension:Moderation is a powerful anti-spam extension for MediaWiki CMS. It protects small/medium wikis against vandalism by sending all edits/uploads from new users to moderation.
https://mediawiki.org/wiki/Extension:Moderation
GNU General Public License v3.0
30 stars 22 forks source link

pending-review notification, it simply doesn't work #42

Closed oasis1234 closed 5 years ago

oasis1234 commented 5 years ago

Ok, I give up. It's been one whole day by trial and error, trying all configurations. Finally I created a blank server with latest Debian, Apache2, PHP and MariaDB versions. Installed latest Mediawiki and Moderation releases. But after an edit, there's no "pending-review" notification. Could you tell me your configuration? I promise I'll try to reproduce the bug, and come back here with details.

edwardspec commented 5 years ago

Please check that you enabled the object cache ($wgMainCacheType should not be CACHE_NONE or some non-working value), because it's used for "New changes await moderation" box.

Could you tell me your configuration?

Please see [tests/travis/ModerationSettings.php] file. It is used for automated tests, which include a test of "New changes await moderation" box.

oasis1234 commented 5 years ago

The installation wizard defaults to "Settings for object caching: PHP object caching (APC, APCu or WinCache), which translates into $wgMainCacheType = CACHE_ACCEL; Anyway, I tried $wgMainCacheType = CACHE_DB; and $wgSessionCacheType = CACHE_DB; However it seems not to be a cache issue. When editing a page, I don't see any notification before, during or after, but when retrying the edit, I can read a green box: "You are editing your version of this article. It is currently awaiting moderation. Once approved, it will be visible to other users." I also used "git clone", which downloads a different version from the "release".

When I said "your configuration" I meant your system versions, e.g. Debian 9, PHP 7.0.30, Apache/2.4.25, MariaDB 10.2.19. PHPUnit testing goes beyond my knowledge. I understand that a professional IT guy will solve this issue tinkering with the code, but I don't have time. I only say that I followed all the instructions, using the latest versions, etc.

Finally I opted for a workaround, and I "patched" the "You are not logged in" warning, adding my text. Anyway, thank you for your answer.

edwardspec commented 5 years ago

First, don't worry, we'll get to a bottom of this.

You are talking about this notification (in my previous message, I assumed that you meant a different feature - "notifying moderators about new pending changes"): pending-review-screenshot

It is displayed by JavaScript in the browser. Therefore it doesn't matter what software is on the server (Apache/PHP/MariaDB), what matters is the browser you are using and whether there are any JS errors in the console.

edwardspec commented 5 years ago

Further troubleshooting steps: 1) Please let me know the browser/OS you were using. It should work in all modern browsers, but who knows. 2) Is the notification shown in Firefox and Chrome? 3) When you are redirected back to the article after saving the edit, does the URL of the article contain the string "modqueued=1"? 4) If you simply add "?modqueued=1" to the URL of any article, will notification be shown? 5) In the browser, open the JavaScript console and see if there are any errors in cases (3) and (4).

Possible reasons (why it doesn't work): it's IE 6 in WinXP (just kidding), some browser addon is interfering, another MediaWiki extension is interfering, some Greasemonkey-like browser scripts are interfering, notification is displayed but is hidden by some CSS styles, etc.

oasis1234 commented 5 years ago

These are the steps that a normal guy will take: Get latest Debian and install: https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-9.6.0-amd64-netinst.iso

apt-get update && apt-get upgrade apt-get install apache2

Default "apt-get install mysql-server" installs MariaDB 10.1, which fails with error "max key length is 767 bytes", so I install latest version 10.3 apt-get install software-properties-common dirmngr apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xF1656F24C74CD1D8 add-apt-repository 'deb [arch=amd64,i386,ppc64el] http://mirror.rackspace.com/mariadb/repo/10.3/debian stretch main' apt-get update apt-get install mariadb-server

=Install PHP 7.1 apt-get install apt-transport-https lsb-release ca-certificates wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list apt-get update apt-get install php7.1 apt-get install php7.1-curl php7.1-gd php7.1-mbstring php7.1-mysql php7.1-xml php7.1-apcu phpinfo() http://testwiki.ml/info.php

mysql -u root -p mysql> CREATE DATABASE my_wiki; psw:

mkdir /var/www/html/w cd /var/www/html/w wget https://releases.wikimedia.org/mediawiki/1.31/mediawiki-1.31.1.tar.gz tar -xvzf mediawiki-1.31.1.tar.gz mv mediawiki-1.31.1/* /var/www/html/w

apt-get install git git clone https://github.com/edwardspec/mediawiki-moderation.git mkdir /var/www/html/w/extensions/Moderation mv mediawiki-moderation/* /var/www/html/w/extensions/Moderation

Install Mediawiki with web wizard: http://testwiki.ml/w/mw-config/index.php Accept defaults. user:admin, psw: Save LocalSettings.php

Here you go: http://testwiki.ml/w/index.php/Main_Page SSH. host:testwiki.ml user:root psw: Browser: Chrome 71. https://github.com/henrypp/chromium/releases/download/v71.0.3578.80-r599034-win64/chromium-sync.zip You can experiment all you want (it's a VM). Enjoy!

edwardspec commented 5 years ago

Please edit the file [extensions/Moderation/extension.json]: add the line

                "jquery.cookie",

after the lines

            "styles": "ext.moderation.notify.css",
            "dependencies": [

... and let me know if the problem disappears after this change.

oasis1234 commented 5 years ago

Bingo! Thanks.

edwardspec commented 5 years ago

Fixed in 1.3.26.