Page MenuHomePhabricator

VE edit link reset when the link is modified through SkinTemplateNavigation::Universal hook
Open, Needs TriagePublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Add a class to $links['views']['ve-edit']['class'] through the SkinTemplateNavigation::Universal hook
  • Wait for page to be fully loaded with Javascript

What happens?:
VE reset the visual edit link to the state before SkinTemplateNavigation::Universal

What should have happened instead?:
VE should not reset the visual edit link

Software version (skip for WMF-hosted wikis like Wikipedia):
MediaWiki 1.39

VE seems to rewrite the #ca-ve-edit content through setupMultiTab, replacing the original content within.

Event Timeline

We rewrite the link in both the PHP SkinTemplateNavigation::Universal hook and in JS code to allow instant(-ish) configuration changes on Wikimedia wikis, where the HTML generated by the PHP code can be cached for several weeks (for logged-out users).

I'd be happy to accept a patch if you work out a way to make this work better with other extensions, while still preserving that feature.

Thanks for the reply.

My use case was using SkinTemplateNavigation::Universal through the skin to append a <span> element containing a icon inside the <a> element inside #ca-ve-edit, but the content inside <a> is rewritten by setupMultiTab in JS.

May I ask what was the original intention for rewriting the link in JS? I can work on a patch if I know the context of why it is written in the first place.

It was to let configuration changes that affect the tabs take effect immediately, even if the site is still serving old cached HTML.