Page MenuHomePhabricator

WhoIsWatching extension (master) throws "Call to undefined method OOUIHTMLForm::getField() exception" when deleting a watcher
Closed, ResolvedPublic

Description

Steps to reproduce:

  • watch a page
  • click on the "xxx watching user" link to get to Special:WhoIsWatching
  • select your user in "Watchers on..." list
  • click "remove user"

Details:
Exception encountered, of type "Error"
[1d693dcc19fe9d1bca124685] /wiki01/index.php/Special:WhoIsWatching/Test Error from line 262 of /var/www/wikis/wiki01/extensions/WhoIsWatching/src/SpecialWhoIsWatching.php: Call to undefined method OOUIHTMLForm::getField()
Backtrace:
#0 /var/www/wikis/wiki01/extensions/WhoIsWatching/src/SpecialWhoIsWatching.php(315): WhoIsWatching\SpecialWhoIsWatching->maybeRemoveWatcher(array, OOUIHTMLForm)
#1 /var/www/wikis/wiki01/includes/htmlform/HTMLForm.php(613): WhoIsWatching\SpecialWhoIsWatching->WhoIsWatching\{closure}(array, OOUIHTMLForm)
#2 /var/www/wikis/wiki01/includes/htmlform/HTMLForm.php(510): HTMLForm->trySubmit()
#3 /var/www/wikis/wiki01/includes/htmlform/HTMLForm.php(525): HTMLForm->tryAuthorizedSubmit()
#4 /var/www/wikis/wiki01/extensions/WhoIsWatching/src/SpecialWhoIsWatching.php(318): HTMLForm->show()
#5 /var/www/wikis/wiki01/extensions/WhoIsWatching/src/SpecialWhoIsWatching.php(74): WhoIsWatching\SpecialWhoIsWatching->showWatchingUsers()
#6 /var/www/wikis/wiki01/includes/specialpage/SpecialPage.php(479): WhoIsWatching\SpecialWhoIsWatching->execute(string)
#7 /var/www/wikis/wiki01/includes/specialpage/SpecialPageFactory.php(577): SpecialPage->run(string)
#8 /var/www/wikis/wiki01/includes/MediaWiki.php(282): SpecialPageFactory::executePath(Title, RequestContext)
#9 /var/www/wikis/wiki01/includes/MediaWiki.php(735): MediaWiki->performRequest()
#10 /var/www/wikis/wiki01/includes/MediaWiki.php(509): MediaWiki->main()
#11 /var/www/wikis/wiki01/index.php(43): MediaWiki->run()
#12 {main}

Event Timeline

@planetenxin In which Mediawiki Version, You are getting this error?

@planetenxin: If you combine MediaWiki 1.27 with the git master of WhoIsWatching extension (instead of its 1.27 branch) then there is no promise that things will work together. Does this problem also happen with the 1.27 branch of the WhoIsWatching extension?

Aklapper removed MarkAHershberger as the assignee of this task.
Aklapper added a subscriber: MarkAHershberger.

Closing as invalid as that public function does not exist in the 1.27 branch of MediaWiki core:

$:acko\> git checkout master
Checking out files: 100% (7543/7543), done.
Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.

$:acko\> grep -r "function getField" .
./HTMLForm.php:	public function getField( $fieldname ) {
./HTMLFormField.php:	protected function getFieldLayoutOOUI( $inputField, $config ) {

$:acko\> git checkout REL1_27
Switched to branch 'REL1_27'
Your branch is up-to-date with 'origin/REL1_27'.

$:acko\> grep -r "function getField" .
./HTMLFormField.php:	protected function getFieldLayoutOOUI( $inputField, $config ) {

Some work could be done on the branch to make it work with 1.27, though, since 1.27 is still an LTS and (anyways),I have some 1.27 wikis to support myself.

I would expect master to support the current LTS, which is MW 1.27. Maybe my assumption is wrong.

I would expect master to support the current LTS, which is MW 1.27. Maybe my assumption is wrong.

That is at the developer's discretion. But I do want this to work in 1.27.

Of course feel free to reopen this task if it's in scope. In the end it's up to the maintainers :)

Aklapper renamed this task from WhoIsWatching extension (master) throws "Call to undefined method OOUIHTMLForm::getField() exeption" when deleting a watcher to WhoIsWatching extension (master) throws "Call to undefined method OOUIHTMLForm::getField() exception" when deleting a watcher.Apr 24 2018, 2:59 PM

Change 429196 had a related patch set uploaded (by MarkAHershberger; owner: MarkAHershberger):
[mediawiki/extensions/WhoIsWatching@master] Add consideration for 1.27

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

I want master to support 1.27 and there are reports that this is still a problem even though there are no calls to getField() now.

MarkAHershberger claimed this task.

User confirmed it isn't a problem.

Change 429196 merged by jenkins-bot:
[mediawiki/extensions/WhoIsWatching@master] Change form update method

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