Page MenuHomePhabricator

Using $this when not in object context when uploading html file or archive in Html2Wiki 1.31
Closed, ResolvedPublic

Description

When uploading an html file or archive, I receive an error in Language.php. No special steps to recreate. Media wiki and Html2wiki on stable 1.31 channel.
Exact error message:

[e51f192c19e9217fef6b5ed5] /mediawiki/index.php?title=Special:Html2Wiki&action=submit Error from line 4829 of /var/lib/mediawiki/languages/Language.php: Using $this when not in object context

Backtrace:

#0 /var/lib/mediawiki/extensions/Html2Wiki/specials/SpecialHtml2Wiki.php(814): Language::formatSize(integer)

#1 /var/lib/mediawiki/extensions/Html2Wiki/specials/SpecialHtml2Wiki.php(857): SpecialHtml2Wiki->formatValue(integer)

#2 /var/lib/mediawiki/extensions/Html2Wiki/specials/SpecialHtml2Wiki.php(964): SpecialHtml2Wiki->addFileToResults()

#3 /var/lib/mediawiki/extensions/Html2Wiki/specials/SpecialHtml2Wiki.php(655): SpecialHtml2Wiki->processFile()

#4 /var/lib/mediawiki/extensions/Html2Wiki/specials/SpecialHtml2Wiki.php(519): SpecialHtml2Wiki->doUpload()

#5 /var/lib/mediawiki/extensions/Html2Wiki/specials/SpecialHtml2Wiki.php(220): SpecialHtml2Wiki->doImport()

#6 /var/lib/mediawiki/includes/specialpage/SpecialPage.php(522): SpecialHtml2Wiki->execute(NULL)

#7 /var/lib/mediawiki/includes/specialpage/SpecialPageFactory.php(568): SpecialPage->run(NULL)

#8 /var/lib/mediawiki/includes/MediaWiki.php(288): SpecialPageFactory::executePath(Title, RequestContext)

#9 /var/lib/mediawiki/includes/MediaWiki.php(861): MediaWiki->performRequest()

#10 /var/lib/mediawiki/includes/MediaWiki.php(524): MediaWiki->main()

#11 /var/lib/mediawiki/index.php(42): MediaWiki->run()

#12 {main}

Event Timeline

Change 442346 had a related patch set uploaded (by Jack Phoenix; owner: Jack Phoenix):
[mediawiki/extensions/Html2Wiki@master] Language#formatSize is *not* static and therefore cannot be called as such

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

What does this mean

I wrote a patch which should hopefully fix the issue you encountered. Once someone reviews it and merges it into master, you should redownload the Html2Wiki extension (for example, via MediaWiki.org's ExtensionDistributor page) -- remember to choose "master (latest development version)" version instead of "1.31 (latest stable version)" from the drop-down menu and replace your old copy of the extension with the new copy. After that the issue should be gone, I hope!

Thanks a bunch ashley! My boss will be very pleased.

Change 442346 merged by jenkins-bot:
[mediawiki/extensions/Html2Wiki@master] Language#formatSize is *not* static and therefore cannot be called as such

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

ashley claimed this task.
ashley removed a project: Patch-For-Review.

Another user reported this. Maybe this should be back ported to REL 1.31 (esp. since that is an LTS release ?)