Extension talk:RatePage/Flow

About this board

Can'r rate the Contest page

4
Lotusccong (talkcontribs)

Running MW 1.39.0, PHP 7.4.32

RatePage 2.13.1

I can create the Contest.but when insert the {{#ratepage:Demo_main_page|Bestbook2023|150}} .

It can show the rating star but can't rate it.

I have cross check that Contest ID is correct with the permission for users to vote and enable the contest.

Any configuration parameter need to be set ?

I can use the normal rate page.

Ostrzyciel (talkcontribs)

This is most likely because something is wrong with the permissions for your contest, please check them again. Otherwise, please use your browser's developer console to capture the relevant response from RatePage's API and send it to me. Without more details, I cannot really say what might be wrong.

Senouis (talkcontribs)

I got the same problem and I'm using RatePage 2.14.0, MW 1.41 with docker.

I sent pageratins query request and 'ratepage' POST api request(edit token included) with javascript and the server returns 'internal_api_error_Error' in both cases. I tried running update.php with force option, but it has no use.

So I send the query request again, but this time I send it through URL and I got the message:

Exception caught: Call to undefined method MediaWiki\\User\\User::getEffectiveGroups()

...

Error at /var/www/html/extensions/RatePage/includes/Rights.php(39)\nfrom /var/www/html/extensions/RatePage/includes/Rights.php(39)\n#0 /var/www/html/extensions/RatePage/includes/Api/RatePageApiTrait.php(105): RatePage\\Rights::checkUserPermissionsOnContest(stdClass, MediaWiki\\User\\User)\n#1 /var/www/html/extensions/RatePage/includes/Api/QueryPageRatingProp.php(30): RatePage\\Api\\QueryPageRatingProp->processParams(array, DerivativeContext, RatePage\\Api\\QueryPageRatingProp)\n#2 /var/www/html/includes/api/ApiQuery.php(695): RatePage\\Api\\QueryPageRatingProp->execute()\n#3 /var/www/html/includes/api/ApiMain.php(1935): ApiQuery->execute()\n#4 /var/www/html/includes/api/ApiMain.php(912): ApiMain->executeAction()\n#5 /var/www/html/includes/api/ApiMain.php(883): ApiMain->executeActionWithErrorHandling()\n#6 /var/www/html/api.php(95): ApiMain->execute()\n#7 /var/www/html/api.php(48): wfApiMain()\n#8 {main}

It seems User class has been changed since MW 1.39.0+. In 1.35.0 release note, it says:

The following methods of the User class are deprecated: getGroups, getGroupMemberships, getEffectiveGroups, getAutomaticGroups, addGroup, removeGroup, getFormerGroups, getAllGroups, getImplicitGroups, addAutopromoteOnceGroups. Use the new UserGroupManager service instead. 

Also, this talk exists: Error: Call to undefined method User::getUserEffectiveGroups() on Extension talk:AccessControl (mediawiki.org)

PS: when I visit 'Special:RatePageContests' I can see a debug log:

Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/extensions/RatePage/includes/Special/RatePageContests.php on line 76

Ostrzyciel (talkcontribs)

Hi, I'm no longer actively developing this extension. RatePage was not tested with MW 1.39+, so the issue is some deprecation. You are welcome to submit a patch to fix this issue: https://gitlab.com/nonsensopedia/extensions/ratepage

In any case, I will add this to my TODO, but I cannot promise when I will fix that – it may be as long as a few months.

Reply to "Can'r rate the Contest page"
62.16.3.184 (talkcontribs)

Block with stars is not displayed in skin Pivot.

62.16.3.184 (talkcontribs)

I can't figure out what code forms this block with stars, so I just paste it in the right place.

Ostrzyciel (talkcontribs)

Hi!

Currently I only support RatePage on Timeless, Vector, and Monobook skins. Moreover, I see that Skin:Pivot is currently unmaintained.

I cannot allocate time to fix this issue, but if you want to do this, go on, pull requests are welcome :)

Farvardyn (talkcontribs)
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.

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.

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

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
Lotusccong (talkcontribs)

PHP 7.4.32, MW 1.39 , SMW 4.02.

When I run the php maintenance/update.php , it show the below error message

PHP Fatal error:  Uncaught Exception: Unable to open file /home/XX/ywfjctmfyw/public_html/extensions/RatePage/extension.json: filemtime(): stat failed for /XX/ywfjctmfyw/public_html/extensions/RatePage/extension.json in /XX/ywfjctmfyw/public_html/includes/registration/ExtensionRegistry.php:199

Stack trace:

#0 /XX/ywfjctmfyw/public_html/includes/GlobalFunctions.php(53): ExtensionRegistry->queue()

#1 /XX/ywfjctmfyw/public_html/LocalSettings.php(823): wfLoadExtension()

#2 /XX/ywfjctmfyw/public_html/includes/Setup.php(218): require_once('/home/XX')

#3 /XX/ywfjctmfyw/public_html/maintenance/doMaintenance.php(83): require_once('/home/XX.')

#4 /XX/ywfjctmfyw/public_html/maintenance/update.php(312): require_once('/home/XX')

#5 {main}

  thrown in /XX/ywfjctmfyw/public_html/includes/registration/ExtensionRegistry.php on line 199

Any ideas how to resolved it ?

Ostrzyciel (talkcontribs)

It seems like for some reason the extension is not in the /home/XX/ywfjctmfyw/public_html/extensions/RatePage directory, you could double-check that. Other than that – I don't know, I haven't yet tried RatePage with MW 1.39. I hope to find some time for this in February.

Lotusccong (talkcontribs)

Yes, I notice that the folfer name is Ratepage, after change to RatePage. Its working now.

TQVM.

How to add the voting widget pixels wide ?

2
Lotusccong (talkcontribs)

The voting widget pixels wide parameter only suppoted in contests parse - {{#ratepage:Main Page|CONTEST1|250}}.

Request to include it on non contest vote parse like {{#ratepage: {{FULLPAGENAME}} }}

It show error when use {{#ratepage: {{FULLPAGENAME}}|250 }}

Ostrzyciel (talkcontribs)

Hi, you can simply leave the contest parameter empty like so: {{#ratepage: {{FULLPAGENAME}}||250}}.

There are no older topics
Return to "RatePage/Flow" page.