RelatedArticles shows on editor
Closed, ResolvedPublic

Description

... and confusingly the results differ from those in view mode.

Jdlrobson added a project: RelatedArticles.
Jdlrobson added a subscriber: Jdlrobson.
Restricted Application added subscribers: StudiesWorld, Aklapper. · View Herald TranscriptDec 7 2015, 10:51 PM
Jdlrobson triaged this task as "High" priority.Dec 8 2015, 6:59 PM
Jdlrobson set Security to None.
bmansurov added a subscriber: bmansurov.EditedDec 9 2015, 10:51 AM

... and confusingly the results differ from those in view mode.

We randomly choose 3 items when there are more than 3.

Can you share the URL of the attached screenshot's page? I cannot reproduce this locally. Thanks.

Florian added a subscriber: Florian.Dec 9 2015, 6:46 PM

Can't reproduce locally, however, you shouldn't load the module on pages with action other than view, btw.

Previously it worked on http://en.wikipedia.beta.wmflabs.org/wiki/Related_test but whilst we are on the train we cannot test on beta labs.

The problem is we don't guard against running in edit mode so if relatedPages.getForCurrentPage( LIMIT ) returns results then it will show.

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

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

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

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

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

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

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

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

bmansurov added a comment.EditedDec 14 2015, 11:12 AM

There are some comments in the patch. Also the solution is a temporary one as described in the commit message. I think we should re-open the bug and fix it properly.