Topic on Extension talk:RatePage

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"