Last modified: 2014-10-17 16:04:59 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 T71789, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 69789 - Title class may return outdated content model
Title class may return outdated content model
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
1.24rc
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-08-20 16:45 UTC by wctaiwan
Modified: 2014-10-17 16:04 UTC (History)
3 users (show)

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


Attachments

Description wctaiwan 2014-08-20 16:45:22 UTC
In eval.php:

> $t1 = Title::newFromText( 'New page' );
> echo $t1->getContentModel();
wikitext
> $page = WikiPage::factory( $t1 );
> $content = ContentHandler::makeContent( 'foo', null, CONTENT_MODEL_TEXT );
> $page->doEditContent( $content, 'summary' );
> $t2 = Title::newFromText( 'New page' );
> echo $t2->getContentModel();
wikitext // should be 'text' instead

This is probably caused by bug 69788 ( $t1->mContentModel, populated in $t1->getContentModel(), ends up being cached and used for $t2).
Comment 1 Gerrit Notification Bot 2014-08-20 16:47:22 UTC
Change 155292 had a related patch set uploaded by Wctaiwan:
Set and get object copies in MapCacheLRU

https://gerrit.wikimedia.org/r/155292
Comment 2 Kevin Israel (PleaseStand) 2014-08-20 22:09:41 UTC
(In reply to wctaiwan from comment #0)
> This is probably caused by bug 69788 ( $t1->mContentModel, populated in
> $t1->getContentModel(), ends up being cached and used for $t2).

At least for this particular case, this bug isn't what you think it is. That code should work because WikiPage::insertOn() calls Title::resetArticleID(), which clears the property in question. I'll upload a patch shortly.
Comment 3 Gerrit Notification Bot 2014-08-20 22:15:53 UTC
Change 155453 had a related patch set uploaded by PleaseStand:
Title::getContentModel(): load from DB if necessary

https://gerrit.wikimedia.org/r/155453
Comment 4 Gerrit Notification Bot 2014-08-21 04:42:17 UTC
Change 155292 abandoned by Wctaiwan:
Set and get object copies in MapCacheLRU

Reason:
Current cache behaviour seems to be expected. Bug 69789 is instead fixed with I94f06baf406afa538cd2b10139598442f9fc6759

https://gerrit.wikimedia.org/r/155292
Comment 5 Gerrit Notification Bot 2014-08-21 15:31:23 UTC
Change 155453 merged by jenkins-bot:
Title::getContentModel(): load from DB if necessary

https://gerrit.wikimedia.org/r/155453
Comment 6 Andre Klapper 2014-10-17 11:43:39 UTC
All patches mentioned in this report were merged or abandoned - is there more work left to do here (if yes: please reset the bug report status to NEW or ASSIGNED), or can you close this ticket as RESOLVED FIXED?
Comment 7 wctaiwan 2014-10-17 16:04:59 UTC
Sorry, I'd just forgotten.

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


Navigation
Links