Page MenuHomePhabricator

PF_FormEdit.php: Call to a member function exists() on null
Closed, ResolvedPublic

Description

[YHl12qqnECRmog5uInyvlgAAAAQ] /w/index.php?namespace=Biologia&target=Biologia%253Atransformaatio&title=Toiminnot:Lomakemuokkaus Error from line 97 of /srv/mediawiki/workdir/extensions/PageForms/specials/PF_FormEdit.php: Call to a member function exists() on null

Backtrace:

#0 /srv/mediawiki/workdir/extensions/PageForms/specials/PF_FormEdit.php(44): PFFormEdit->printForm(string, string, NULL)
#1 /srv/mediawiki/workdir/includes/specialpage/SpecialPage.php(600): PFFormEdit->execute(NULL)
#2 /srv/mediawiki/workdir/includes/specialpage/SpecialPageFactory.php(635): SpecialPage->run(NULL)
#3 /srv/mediawiki/workdir/includes/MediaWiki.php(307): MediaWiki\SpecialPage\SpecialPageFactory->executePath(Title, RequestContext)
#4 /srv/mediawiki/workdir/includes/MediaWiki.php(940): MediaWiki->performRequest()
#5 /srv/mediawiki/workdir/includes/MediaWiki.php(543): MediaWiki->main()
#6 /srv/mediawiki/workdir/index.php(53): MediaWiki->run()
#7 /srv/mediawiki/workdir/index.php(46): wfIndexMain()
#8 {main}

Versions: 5.1 and 5.2. The issue is that in https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/PageForms/+/refs/tags/5.2/specials/PF_FormEdit.php#97 Title::newFromText can return null for invalid titles, which needs to be checked. The page name in target is double-encoded, and not a valid title. I am not sure what is causing this double encoding.

Event Timeline

Change 922531 had a related patch set uploaded (by Techwizzie; author: Techwizzie):

[mediawiki/extensions/PageForms@master] Fix call to exists() when title object is null or invalid

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

Change 922531 merged by jenkins-bot:

[mediawiki/extensions/PageForms@master] Fix call to exists() when title object is null or invalid

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

Yaron_Koren claimed this task.

Fixed, I think - this patch gets rid of the error message, and possibly fixes the issue with invalid titles in the first place.