Topic on Extension talk:RatePage

Error 1146: Table 'my_wiki.ratepage_vote' doesn't exist

6
Noloader (talkcontribs)

I am running MW 1.35.2. I installed RatePage in `extensions` through Gitlab. I switched to `REL1_35` branch (which does not exist, so I am using the tip of Master). I added `wfLoadExtension('RatePage');` to `LocalSettings.php`. I am running `update.php`. The update script results in:

...
...site_global_key in table sites already modified by patch patch-sites-site_global_key.sql.
...iwl_prefix in table iwlinks already modified by patch patch-extend-iwlinks-iwl_prefix.sql.
...ratepage_vote table already exists.
...have rv_contest field in ratepage_vote table.
Modifying rv_contest field of table ratepage_vote ...
Wikimedia\Rdbms\DBQueryError from line 1699 of /var/www/html/w/includes/libs/rdbms/database/Database.php: Error 1146: Table 'my_wiki.ratepage_vote' doesn't exist (localhost)
Function: Wikimedia\Rdbms\Database::sourceFile( /var/www/html/w/extensions/RatePage/includes/../sql/update/upgrade-from-0.3-to-1.0.sql )
Query: ALTER TABLE ratepage_vote MODIFY COLUMN rv_user varbinary(255)


#0 /var/www/html/w/includes/libs/rdbms/database/Database.php(1683): Wikimedia\Rdbms\Database->getQueryException()
#1 /var/www/html/w/includes/libs/rdbms/database/Database.php(1658): Wikimedia\Rdbms\Database->getQueryExceptionAndLog()
#2 /var/www/html/w/includes/libs/rdbms/database/Database.php(1227): Wikimedia\Rdbms\Database->reportQueryError()
#3 /var/www/html/w/includes/libs/rdbms/database/Database.php(5073): Wikimedia\Rdbms\Database->query()
#4 /var/www/html/w/includes/libs/rdbms/database/Database.php(5008): Wikimedia\Rdbms\Database->sourceStream()
#5 /var/www/html/w/includes/libs/rdbms/database/DBConnRef.php(68): Wikimedia\Rdbms\Database->sourceFile()
#6 /var/www/html/w/includes/libs/rdbms/database/MaintainableDBConnRef.php(35): Wikimedia\Rdbms\DBConnRef->__call()
#7 /var/www/html/w/includes/installer/DatabaseUpdater.php(769): Wikimedia\Rdbms\MaintainableDBConnRef->sourceFile()
#8 /var/www/html/w/includes/installer/DatabaseUpdater.php(1085): DatabaseUpdater->applyPatch()
#9 /var/www/html/w/includes/installer/DatabaseUpdater.php(554): DatabaseUpdater->modifyField()
#10 /var/www/html/w/includes/installer/DatabaseUpdater.php(522): DatabaseUpdater->runUpdates()
#11 /var/www/html/w/maintenance/update.php(181): DatabaseUpdater->doUpdates()
#12 /var/www/html/w/maintenance/doMaintenance.php(107): UpdateMediaWiki->execute()
#13 /var/www/html/w/maintenance/update.php(253): require_once('/var/www/html/w...')
#14 {main}

Naively, this looks like a problem:

my_wiki.ratepage_vote

my_wiki is the name of our wiki database. But we have two different wikis in the database, and each has prefix on its table names:

# grep prefix LocalSettings.php
$wgDBprefix         = "wikicryptopp_";

And:

mysql> use my_wiki;
...
mysql> show tables;
+------------------------------------+
| Tables_in_my_wiki                  |
+------------------------------------+
| wikicryptopp_actor                 |
| wikicryptopp_archive               |
| ...                                |
| wikicryptopp_querycache            |
| wikicryptopp_querycache_info       |
| wikicryptopp_querycachetwo         |
| wikicryptopp_ratepage_vote         |
| wikicryptopp_recentchanges         |
| wikicryptopp_redirect              |
| wikicryptopp_revision              |
| wikicryptopp_revision_actor_temp   |
| wikicryptopp_revision_comment_temp |
| ...                                |
| wikilounge_archive                 |
| ...                                |
+------------------------------------+
Ostrzyciel (talkcontribs)

Thank you for the detailed report! It seems the issue was that I forgot to take into account table prefixes in update scripts. I fixed this on the master branch, version 2.10.2 should be free of the problem. Please let me know in case it didn't work :)

The master branch is (or at least should be) perfectly compatible with REL1_35.

Noloader (talkcontribs)

Thanks @Ostrzyciel.

Yes,it is working now.

One last question... How do I limit voting to authenticated users? I.e., non-anonymous users?

Thanks in advance.

Noloader (talk) 10:20, 13 April 2021 (UTC)

Ostrzyciel (talkcontribs)

There is no way to do this for now, sadly, I just didn't have a need for this.

I might look into implementing this, but my time is rather limited. The implementation should not be too hard, you are welcome to submit any merge requests to the repo: https://gitlab.com/nonsensopedia/extensions/ratepage

Noloader (talkcontribs)

Thanks again @Ostrzyciel.

OK, we'll give it a try with anonymous user voting.

I planned on using the RatePage results to identify bad articles that need re-writing. If anonymous users spam the results we'll disable the extension until someone cuts in the functionality.

Sorry I can't help with the implementation. I'm a C/C++/ObjC guy. I don't really know Python or PHP.

Thanks again.

Noloader (talk) 10:47, 13 April 2021 (UTC)

Ostrzyciel (talkcontribs)

@Noloader I'm glad to inform you that thanks to @Sir Polskacafe RatePage now supports this feature. Please check out from the master branch and configure it accordingly. In your case it's probably going to be:

$wgGroupPermissions['user']['ratepage-vote'] = true;
$wgGroupPermissions['*']['ratepage-vote'] = false; // disable the default