Page MenuHomePhabricator

RelatedArticles disappears during edit process when using VisualEditor
Closed, ResolvedPublic0 Estimate Story Points


Steps to reproduce:

  • You need a working RelatedArticles extension with read more in the footer setup, also a working VE environment
  • Edit a page and add some related articles (e.g. with the {{#related:}} parser tag or Cirrus, doesn't matter)
  • Open this page and start VE with the "edit" key

Expected result:

  • The relatedArticles content should be removed and re-added, after the edit was saved (or VE was canceled)
  • On cancelling an edit the relatedArticles should show again.

It seems there are several problems

  • There is no hook for abandoning an edit
  • The hook ve.activate doesn't run before the loader shows, so it's impossible to detach the related articles widget upon clicking the edit link. Is there a hook before that?
  • When appending the related articles widget back into the content on ve.deactivate it appears above the content. Expected: content should be added to DOM before hook is run.

The read more box is hidden via css above the VE content-editable:


Related Gerrit Patches:
mediawiki/extensions/RelatedArticles : wmf/1.27.0-wmf.8Disable RelatedArticles when editor enabled
mediawiki/extensions/RelatedArticles : devDisable RelatedArticles when editor enabled

Event Timeline

Florian created this task.Dec 4 2015, 10:06 PM
Florian raised the priority of this task from to Needs Triage.
Florian updated the task description. (Show Details)
Florian added a subscriber: Florian.
Restricted Application added subscribers: StudiesWorld, Aklapper. · View Herald TranscriptDec 4 2015, 10:06 PM

Oops. Normally code like this inserts into the contentSub which VE carefully removes, but that doesn't exist in Minerva so "just do that" might be hard?

Hmm, I would like to mentor this in GCI (and I will create a task in GCI for that), but first, I think we need to clarify, what we need to do :)

Where do we want to move the related articles box to? @Jdforrester-WMF: Do you really mean #contentSub (which is under the title)? Are there any footer-container, that are properly removed by VE, or maybe _outside_ of a special container (#bodyContent, .content??) :)

It shouldn't appear when VE is open.
It's an article enhancement not part of the content.

We need to get this done asap to make next Monday's branch so I was just putting the tag on to maximise chances of getting it done.

So on second thoughts this isn't as much as a blocker as I thought to us - as it only impacts pages which use the related magic word - it doesn't impact the general case of API driven results.

Also on second pass this is an issue with/question for VisualEditor. How do we add content to #bodyContent that VisualEditor ignores.

I see the updating of related articles as a separate issue. Right now I'm keen for it not to be pulled to the top of the article. It should appear below as it is generated outside the wikitext content.

Jdlrobson lowered the priority of this task from High to Medium.Dec 9 2015, 7:05 PM
Jdlrobson edited projects, added VisualEditor; removed Google-Code-In-2015, good first task.

Change 258061 had a related patch set uploaded (by Jdlrobson):
Disable RelatedArticles when editor enabled

Change 258062 had a related patch set uploaded (by Jdlrobson):
Disable RelatedArticles when editor enabled

I decided it's probably enough to simply hide this and rely on the .ve-activated class
Would appreciate a quick merge so we can get this in production and start gathering feedback as soon as possible.

Change 258061 merged by jenkins-bot:
Disable RelatedArticles when editor enabled

Jdlrobson renamed this task from RelatedArticles conflicts with VisualEditor to RelatedArticles disappears during edit process when using VisualEditor.Dec 10 2015, 1:04 AM
Jdlrobson updated the task description. (Show Details)
Jdlrobson removed a project: Patch-For-Review.

Change 258062 merged by jenkins-bot:
Disable RelatedArticles when editor enabled

Is this now fixed? Everything looks good in testing to me…

bmansurov closed this task as Resolved.Dec 14 2015, 11:06 AM
bmansurov added a subscriber: bmansurov.
Jdforrester-WMF set the point value for this task to 0.Jun 14 2016, 11:55 AM