Last modified: 2014-06-23 13:44:51 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T45737, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 43737 - PHP Catchable fatal error: Argument 1 passed to ContentHandler::getContentText() must implement interface Content, boolean given ContentHandler line 95 - on certain extension(s)
PHP Catchable fatal error: Argument 1 passed to ContentHandler::getContentTe...
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
RSS (Other open bugs)
master
All All
: High normal (vote)
: ---
Assigned To: T. Gries
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-01-08 14:49 UTC by T. Gries
Modified: 2014-06-23 13:44 UTC (History)
11 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description T. Gries 2013-01-08 14:49:40 UTC
PHP Catchable fatal error:  Argument 1 passed to ContentHandler::getContentText() must implement interface Content, boolean given, called in /srv/www-ssl/htdocs/phase3/includes/Article.php on line 390 and defined in /srv/www-ssl/htdocs/phase3/includes/content/ContentHandler.php on line 95

Version
- commit 006916cd3f47bc07ce54830ab35520b69f2e87c1
- Author: Siebrand Mazeland <s.mazeland@xs4all.nl>
- Date:   Tue Jan 8 14:59:58 2013 +0100
Comment 1 Max Semenik 2013-01-08 14:51:22 UTC
Call stack? Installed extensions?
Comment 2 T. Gries 2013-01-08 14:59:06 UTC
Max, good point. I made a bisect and found that (unluckily, my current work target) extension:RSS causes this. 

I pulled the 00691 version today in order to upgrade my wikis. 

Any idea what can be the reason, why E:RSS causes this error ?
I will downgrade the importance, because it's not a mere core issue, apparently.
Comment 3 Marius Hoch 2013-01-08 15:01:47 UTC
Please set $wgShowExceptionDetails = true; in your LocalSettings and post the call stack here ;)
Comment 4 T. Gries 2013-01-08 15:08:22 UTC
did so. But no output at all (white screen).
Comment 5 T. Gries 2013-01-08 15:17:59 UTC
I will start again - with a fresh chechkout.
Comment 6 T. Gries 2013-01-08 15:38:26 UTC
debug log file says 

- Article::fetchContentObject failed to find page data for title MediaWiki:Rss-item

Even when Article:fetchContentObject fails, it should - in my view - never cause a fatal PHP error.


RSS.i18n.php initializes the message correctly to
- 'rss-item' => '{{$1 | title = {{{title}}} | link = {{{link}}} | date = {{{date}}} | author = {{{author}}} | description = {{{description}}} }}'


After pulling the new core version, I did "php update.php". Should I run further maintenance scripts ?
Comment 7 T. Gries 2013-01-08 15:58:30 UTC
I now successfully run all - except wikis - with unchanged E:RSS. Except the one wiki with verion 00691, but ...

... the Main_page of that wiki does not work with E:RSS, however, _other_ pages of that wiki do work as they should. 

Can the reason be a database table problem ?

What do you suggest me to do ?
Comment 8 T. Gries 2013-01-08 16:27:14 UTC
I could isolate the bug, it's due to a problem with the templates used in the extension RSS
Comment 9 T. Gries 2013-01-08 16:29:17 UTC
perhaps the sandbox parsing in wrong context
Comment 10 jrsusenet-bugzilla1401 2014-01-09 12:33:57 UTC
I am getting nearly the same error:

Argument 1 passed to ContentHandler::getContentText() must implement interface Content, boolean given, called in /var/www/html/wiki/includes/Article.php on line 389 and defined in /var/www/html/wiki/includes/content/ContentHandler.php on line 95

Although I activated stack trace, I got no additional output.

System 	Linux 2.6.18-348.18.1.el5 #1 SMP Thu Sep 26 15:05:49 EDT 2013 i686 

Apache Version 	Apache/2.2.3 (CentOS) 
PHP Version 5.3.3

Error message comes up in left navigation bar in "tools" box just below "Page Information" item.

Installed extensions in extension directory:

drwxr-xr-x 3  997 1004 4096 Dec  6 23:14 Cite
drwxr-xr-x 4  997 1004 4096 Dec  6 23:13 ConfirmEdit
drwxr-xr-x 3  997 1004 4096 Dec  6 23:14 Gadgets
drwxr-xr-x 2  997 1004 4096 Dec  6 23:14 ImageMap
drwxr-xr-x 2  997 1004 4096 Dec  6 23:14 InputBox
drwxr-xr-x 2  997 1004 4096 Dec  6 23:14 Interwiki
drwxr-xr-x 3  997 1004 4096 Dec  6 23:14 LocalisationUpdate
drwxr-xr-x 3 wiki wiki 4096 Sep  9 10:52 MultiUpload
drwxr-xr-x 2  997 1004 4096 Dec  6 23:13 Nuke
drwxr-xr-x 3  997 1004 4096 Dec  6 23:14 ParserFunctions
drwxr-xr-x 2  997 1004 4096 Dec  6 23:13 PdfHandler
drwxr-xr-x 2  997 1004 4096 Dec  6 23:13 Poem
-rw-rw-r-- 1  997 1004 1106 Dec  6 23:13 README
drwxr-xr-x 3  997 1004 4096 Dec  6 23:14 Renameuser
drwxr-xr-x 2  997 1004 4096 Dec  6 23:13 SimpleAntiSpam
drwxr-xr-x 2  997 1004 4096 Dec  6 23:14 SpamBlacklist
drwxr-xr-x 3  997 1004 4096 Dec  6 23:13 SyntaxHighlight_GeSHi
drwxr-xr-x 5  997 1004 4096 Dec  6 23:14 TitleBlacklist
drwxr-xr-x 3 wiki wiki 4096 Aug 31 23:35 TreeAndMenu
drwxr-xr-x 3 wiki wiki 4096 Sep  3 20:56 Vector
drwxr-xr-x 4  997 1004 4096 Dec  6 23:14 WikiEditor
Comment 11 MZMcBride 2014-05-01 13:53:01 UTC
This bug appears to be (now?) affecting mediawiki.org as https://www.mediawiki.org/wiki/MediaWiki/Homepage_redesign/Preview returns:

---
PHP fatal error in /usr/local/apache/common-local/php-1.24wmf2/includes/content/ContentHandler.php line 94: 
Argument 1 passed to ContentHandler::getContentText() must implement interface Content, boolean given, called in /usr/local/apache/common-local/php-1.24wmf2/includes/Article.php on line 390 and defined
---

Eep!

This issue may be related to the RSS MediaWiki extension, though comment 10 suggests otherwise.
Comment 12 Gerrit Notification Bot 2014-05-01 14:14:07 UTC
Change 130835 had a related patch set uploaded by Anomie:
Avoid fatal in Article::fetchContent()

https://gerrit.wikimedia.org/r/130835
Comment 13 Brad Jorsch 2014-05-01 14:18:37 UTC
So the root cause of the bug is that Article::fetchContent() doesn't bother to check whether it actually got a Content object before trying to use it. The error on https://www.mediawiki.org/wiki/MediaWiki/Homepage_redesign/Preview is coming via the RSS extension, while the error in comment 10 is presumably some other extension calling that same method.

Note that Article::fetchContent() is deprecated and extensions should be adjusted to not use it anymore, but in the mean time there's no excuse for it fataling for something as simple as being asked for the content of a nonexistent page.
Comment 14 Gerrit Notification Bot 2014-05-01 14:25:45 UTC
Change 130837 had a related patch set uploaded by Aude:
Check if template title exists, if not fallback to Rss-feed

https://gerrit.wikimedia.org/r/130837
Comment 15 Gerrit Notification Bot 2014-05-01 14:33:50 UTC
Change 130835 merged by jenkins-bot:
Avoid fatal in Article::fetchContent()

https://gerrit.wikimedia.org/r/130835
Comment 16 Gerrit Notification Bot 2014-05-01 14:35:23 UTC
Change 130838 had a related patch set uploaded by Anomie:
Avoid fatal in Article::fetchContent()

https://gerrit.wikimedia.org/r/130838
Comment 17 Gerrit Notification Bot 2014-05-01 15:31:40 UTC
Change 130838 merged by jenkins-bot:
Avoid fatal in Article::fetchContent()

https://gerrit.wikimedia.org/r/130838
Comment 18 Derk-Jan Hartman 2014-06-22 12:50:14 UTC
@Brad, is this fixed now ?

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links