Page MenuHomePhabricator

Voting buttons without function
Closed, ResolvedPublic

Description

Im MW 1.31.6 (SMW 3.1.5) the voting up and down buttons to not work. All other buttons are working and $wgCommentStreamsEnableTalk is set to true.

But if you click on either, nothing happens.

Can anybody confirm this?

PHP 7.2.28 (litespeed)
MariaDB 10.3.22-MariaDB
Comment Streams 4.6

Event Timeline

Change 588153 had a related patch set uploaded (by Cicalese; owner: Cicalese):
[mediawiki/extensions/CommentStreams@master] Fixed bug enabling/disabling voting buttons

https://gerrit.wikimedia.org/r/588153

cicalese subscribed.

Thank you for reporting that! Please test the patch and give it a +1 if it fixes the problem for you.

Thank you for working on this. What I did on a testwiki:

git pull
From https://github.com/wikimedia/mediawiki-extensions-CommentStreams
   7668e35..fe604d0  master     -> origin/master
Updating 7668e35..fe604d0
Fast-forward
 extension.json                   |  3 ++-
 i18n/ar.json                     |  4 ++--
 i18n/bg.json                     |  4 ++--
 i18n/cs.json                     |  2 +-
 i18n/fr.json                     |  4 ++--
 i18n/gl.json                     |  4 ++--
 i18n/he.json                     |  7 ++++---
 i18n/hi.json                     |  4 ++--
 i18n/io.json                     |  4 +++-
 i18n/ja.json                     |  2 +-
 i18n/nb.json                     |  2 +-
 i18n/nl.json                     |  4 ++--
 i18n/ps.json                     |  4 ++--
 i18n/pt.json                     |  4 ++--
 i18n/sd.json                     |  4 ++--
 i18n/sv.json                     |  4 ++--
 i18n/ti.json                     |  2 +-
 i18n/tr.json                     |  4 ++--
 i18n/ug-arab.json                |  4 ++--
 i18n/uk.json                     | 10 +++++-----
 i18n/zh-hant.json                |  4 ++--
 includes/ApiCSDeleteComment.php  | 26 +++++++++++++++++++-------
 includes/ApiCSEditComment.php    | 20 ++++++++++++++++----
 includes/Comment.php             | 47 ++++++++++++++++++++++++++++++++++++++---------
 includes/CommentStreamsHooks.php | 15 +++++++++++++--
 package-lock.json                | 94 +++++++++++++++++++++++++++++++++++++---------------------------------------------------------
 package.json                     |  2 +-
 27 files changed, 168 insertions(+), 120 deletions(-)

after that it a commentStremams testpage threw an error:

Fatal error: Uncaught ArgumentCountError: Too few arguments to function MediaWiki\Storage\RevisionStore::getTimestampFromId(), 1 passed in extensions/CommentStreams/includes/Comment.php on line 409 and at least 2 expected in includes/Storage/RevisionStore.php:1855 Stack trace: #0 extensions/CommentStreams/includes/Comment.php(409): MediaWiki\Storage\RevisionStore->getTimestampFromId(35777) #1 extensions/CommentStreams/includes/Comment.php(420): Comment->getModificationTimestamp() #2 extensions/CommentStreams/includes/Comment.php(455): Comment->getModificationDate() #3 extensions/CommentStreams/includes/CommentStreams.php(179): Comment->getJSON() #4 CommentStreams/includes/CommentStreams.php(80): CommentStreams->getComments(Object(OutputPage)) #5CommentStreams/includes/CommentStreamsHooks.php(299): CommentStreams->init(Object(OutputPage)) #6 testwiki/includes/Storage/RevisionStore.php on line 1855

Then I did a git checkout REL1_31. I am now on CommentStreams 4.4 where the voting is working fine.
I can switch to REL1_33 which is also working, but REL!_34 and master are not.

I probably did something wrong, because I was supposed to check a specific patch, not the releases, right?
So I switched back to master and did a
git fetch "https://gerrit.wikimedia.org/r/mediawiki/extensions/CommentStreams" refs/changes/53/588153/2 && git checkout FETCH_HEAD

but the error message remains. Running upgrade.php again did also not help.

Your last instructions for checking out the patch look correct:

git fetch "https://gerrit.wikimedia.org/r/mediawiki/extensions/CommentStreams" refs/changes/53/588153/2 && git checkout FETCH_HEAD

The patch should definitely work with MediaWiki 1.34. That is where I initially tested it. However, thank for your discovering that it will not work currently with 1.31. While the patch itself is fine, an intervening patch broke backward compatibility with 1.31. I've filed T250109 to track that bug. Once that is fixed, this patch should then work.

OK, T250109 is now resolved. Could you please test this patch again, @Krabina ? Thanks!

No. When I switch to master the error is gone, but the voting buttons are not operational.

When I re-apply this patch with the above command, the error shows again:

Fatal error: Uncaught ArgumentCountError: Too few arguments to function MediaWiki\Storage\RevisionStore::getTimestampFromId(), 1 passed in extensions/CommentStreams/includes/Comment.php on line 409 and at least 2 expected in includes/Storage/RevisionStore.php:1855 Stack trace: #0 extensions/CommentStreams/includes/Comment.php(409): MediaWiki\Storage\RevisionStore->getTimestampFromId(35777) #1 extensions/CommentStreams/includes/Comment.php(420): Comment->getModificationTimestamp() #2 extensions/CommentStreams/includes/Comment.php(455): Comment->getModificationDate() #3 extensions/CommentStreams/includes/CommentStreams.php(179): Comment->getJSON() #4 extensions/CommentStreams/includes/CommentStreams.php(80): CommentStreams->getComments(Object(OutputPage)) #5 extensions/CommentStreams/includes/CommentStreamsHooks.php(299): CommentStreams->init(Object(OutputPage)) #6 /home/kdz in includes/Storage/RevisionStore.php on line 1855

Ah, sorry, I forgot to rebase the patch. Please try again with patch set 3:

git fetch "https://gerrit.wikimedia.org/r/mediawiki/extensions/CommentStreams" refs/changes/53/588153/3 && git checkout FETCH_HEAD

yes, I can confirm this is working now! Tried it on 2 different wikis.

Change 588153 merged by jenkins-bot:
[mediawiki/extensions/CommentStreams@master] Fixed bug enabling/disabling voting buttons

https://gerrit.wikimedia.org/r/588153

Great! The patch is merged, and version 4.7 is tagged and documented.

cicalese removed a project: Patch-For-Review.
cicalese moved this task from Needs Review For Me to Closed on the User-Cicalese board.