Make the context page the edited page in EditPages
This forces the WikiPage returned by $this->getContext()->getPage() to be the same as $this->page. This seems to be redundant at the moment, but it seems prudent to make sure this does not break. Having two WikiPage instances may cause subtle problems, such as redundant parsing of content during edits. Bug: T205369 Change-Id: I8dd3235ec395fa8772ad810f8b09a098a940ab0c
This commit is contained in:
parent
595640d90d
commit
501bb93e3e
1 changed files with 9 additions and 1 deletions
|
|
@ -476,7 +476,15 @@ class EditPage {
|
|||
$this->mArticle = $article;
|
||||
$this->page = $article->getPage(); // model object
|
||||
$this->mTitle = $article->getTitle();
|
||||
$this->context = $article->getContext();
|
||||
|
||||
// Make sure the local context is in sync with other member variables.
|
||||
// Particularly make sure everything is using the same WikiPage instance.
|
||||
// This should probably be the case in Article as well, but it's
|
||||
// particularly important for EditPage, to make use of the in-place caching
|
||||
// facility in WikiPage::prepareContentForEdit.
|
||||
$this->context = new DerivativeContext( $article->getContext() );
|
||||
$this->context->setWikiPage( $this->page );
|
||||
$this->context->setTitle( $this->mTitle );
|
||||
|
||||
$this->contentModel = $this->mTitle->getContentModel();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue