Extension talk:RatePage

About this board

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
Reply to "Error 1146: Table 'my_wiki.ratepage_vote' doesn't exist"

using page title magic word in widget

2
Farvardyn (talkcontribs)

Is this a valid tag?

{{#ratepage:{{ <PAGENAME > }}}}

I mean using the magic word for page title is possible?

Ostrzyciel (talkcontribs)

Yes, but you probably should use FULLPAGENAME that returns the name with the namespace prefix:

{{#ratepage:{{FULLPAGENAME}} }}

See: Help:Magic_words#Page_names

Reply to "using page title magic word in widget"

Ratepage Main votes widget bug

3
Pipsteer (talkcontribs)

I'm trying to insert a widget next to my page titles from within a template, to vote for the page itself.


Currently my call looks like:

{{#ratepage: {{FULLPAGENAME}} }}

However, the widget doesn't respond when clicking on it. If I change my widget call to vote in a contest:

{{#ratepage: {{FULLPAGENAME}}|Contest }}

It works fine...

Ostrzyciel (talkcontribs)

I just checked and... Ouch! You are right, this is currently broken. A fix should be simple, I'll look into this soon, maybe even today.

Thanks for the report! :)

Ostrzyciel (talkcontribs)

I made a patch, the issue should now be resolved on the master branch.

Reply to "Ratepage Main votes widget bug"
Farvardyn (talkcontribs)

Is

{{#ratepage:{{ <PAGENAME > }}}}

a valid tag? I mean using the magic world for page title is possible?

Ostrzyciel (talkcontribs)

If I understand correctcly you mean: {{#ratepage:{{PAGENAME}} }}

This should work fine and will let you rate the page the tag is on. Let me know if it doesn't work for you :)

Farvardyn (talkcontribs)

Thanks, It worked but found a bug, I posted it in a separate thread.

Ostrzyciel (talkcontribs)

Thanks for reporting these. As I've noted in the task, I should get around to looking into it in a few days. Hopefully.

Reply to "RatePage valid tag"
Farvardyn (talkcontribs)
Reply to "report a bug"
There are no older topics
Return to "RatePage" page.