Last modified: 2013-12-13 19:03:58 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 T60451, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 58451 - TextContent::preSaveTransform shouldn't return a WikitextContent when $this isn't a WikitextContent
TextContent::preSaveTransform shouldn't return a WikitextContent when $this i...
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
ContentHandler (Other open bugs)
1.23.0
All All
: Unprioritized normal (vote)
: 1.23.0 release
Assigned To: Brad Jorsch
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-12-13 18:20 UTC by Brad Jorsch
Modified: 2013-12-13 19:03 UTC (History)
2 users (show)

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


Attachments

Description Brad Jorsch 2013-12-13 18:20:03 UTC
Consider this API call:

https://en.wikipedia.org/w/api.php?action=parse&text=Test%0A&pst=&onlypst=&contentformat=text%2Fplain&contentmodel=text

It gives an error "Exception Caught: Format text/plain is not supported for content model wikitext", which makes no sense because the content model passed was text rather than wikitext. It works fine if you remove the trailing newline (the %0A).

The problem turns out to be in TextContent::preSaveTransform: if there is trailing whitespace in the input then it returns a WikitextContent rather than a Content object of the same class as $this.
Comment 1 Gerrit Notification Bot 2013-12-13 18:21:20 UTC
Change 101238 had a related patch set uploaded by Anomie:
Fix TextContent::preSaveTransform() return type

https://gerrit.wikimedia.org/r/101238
Comment 2 Gerrit Notification Bot 2013-12-13 19:03:58 UTC
Change 101238 merged by jenkins-bot:
Fix TextContent::preSaveTransform() return type

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

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


Navigation
Links