Page MenuHomePhabricator

Page that transclude sections from non-visually-editable namespaces incorrectly get visual "edit" section links for them
Open, LowPublic

Assigned To
None
Authored By
matej_suchanek
Jan 17 2018, 9:19 AM
Referenced Files
F12618385: obrazek.png
Jan 17 2018, 3:50 PM
F12618388: obrazek.png
Jan 17 2018, 3:50 PM
F12616313: Screen Shot 2018-01-17 at 12.34.16.png
Jan 17 2018, 12:41 PM
F12616321: Screen Shot 2018-01-17 at 12.35.18.png
Jan 17 2018, 12:41 PM
F12616323: Screen Shot 2018-01-17 at 12.35.30.png
Jan 17 2018, 12:41 PM
F12616315: Screen Shot 2018-01-17 at 12.34.28.png
Jan 17 2018, 12:41 PM

Description

After loading this page in cswiki, the edit section links are both "edit source" although the first one opens the visual editor.

I debugged the scripts a bit (debug=1&safemode=1): Before executing JavaScript, there is only a single "edit source". When that finally happens, JavaScript tries to add the missing one by cloning the original one. However, since the condition on line 703 is false (mw.config.get( 'wgVisualEditorConfig' ).tabMessages.editsource is null which needs to be fixed), it keeps the original text.

Event Timeline

Deskana changed the task status from Open to Stalled.Jan 17 2018, 12:41 PM
Deskana subscribed.

It's working fine for me. Both viewing the page normally and viewing the page with ?debug=1&safemode=1 show two tabs, both labelled correctly. Can you provide some screenshots, please? Any other details you have would also be helpful.

Logged out, normal view:

Screen Shot 2018-01-17 at 12.34.16.png (608×2 px, 161 KB)

Logged out, debug and safe mode on:

Screen Shot 2018-01-17 at 12.34.28.png (616×2 px, 140 KB)

Logged in, normal view: (ignore the pink background, that's some custom CSS)

Screen Shot 2018-01-17 at 12.35.18.png (604×2 px, 175 KB)

Logged out, debug and safe mode on:

Screen Shot 2018-01-17 at 12.35.30.png (620×2 px, 154 KB)

matej_suchanek changed the task status from Stalled to Open.Jan 17 2018, 3:50 PM

Do we mean the same?

obrazek.png (456×1 px, 32 KB)

In English:

obrazek.png (454×934 px, 30 KB)

Deskana set the point value for this task to 1.

I see. I missed that you said "section link" in your description. Screenshots are always helpful to work around my hastiness. :-)

Fixing a bug present on only one page is not a priority.

Deskana renamed this task from Specific page gets "edit source" section link twice to One specific page gets "edit source" section link twice on the Czech Wikipedia.Jan 18 2018, 12:42 PM
Deskana moved this task from To Triage to Freezer on the VisualEditor board.
Jan.Kamenicek renamed this task from One specific page gets "edit source" section link twice on the Czech Wikipedia to Some specific pages get "edit source" section link twice on the Czech Wikipedia.Jan 20 2018, 10:07 AM

Looks like I have accidentally partially fixed this in rEVED62273183a834: Simplify handling of messages for section edit links, fixing the issue that @matej_suchanek pointed out in this task's description. These pages will now have normal "edit" / "edit source" links for each section.

But the real problem is that they should not have "edit" links at all, only "edit source"! These sections are transcluded from the Template namespace, which is not visually editable. Our PHP code handles this correctly and only renders a single "edit source" link. But the JS code incorrectly assumes that the lack of an "edit" link means the PHP code did not run, and it adds a second link. This second link, when clicked, will incorrectly open the visual editor for the current page, rather than the transcluded page.

(Maybe related task? T53675)

matmarex renamed this task from Some specific pages get "edit source" section link twice on the Czech Wikipedia to Page that transclude sections from non-visually-editable namespaces incorrectly get visual "edit" section links for them.Nov 2 2018, 1:06 PM
matmarex removed the point value for this task.

FYI, I have just disabled all section links on the page in the task description using the magic word. But before doing so, I verified this was still the problem (described in detail by @matmarex above).