Page MenuHomePhabricator

Under `view/lang/zid` routes, Edit pages are rendered with "viewmode=true" even if `?action=edit` is present
Closed, ResolvedPublicBUG REPORT

Description

Description

Steps to reproduce:

  1. Go to the function edit page using wiki/zid and ?action=edit : https://wikifunctions.beta.wmflabs.org/wiki/Z10014?action=edit
    • This is the correct page, it's fully editable
  2. Go to the edit page using view/lang/zid and ?action=edit: https://wikifunctions.beta.wmflabs.org/view/en/Z10014?action=edit
    • Vue reads action=edit and sets up the edit page
    • However, PHP sets viewmode=true,
    • so the whole document around the vue app is set as a view page, and
    • the parts of the vue app that look at the viewmode variable, are rendered as view

Screenshot from 2023-07-27 16-03-34.png (1×964 px, 104 KB)

  • in yellow: parts in edit mode
  • in pink: parts in view mode

Screenshot from 2023-07-27 16-03-342.png (1×964 px, 137 KB)

Expected behavior (Acceptance criteria):

  • View page should be correctly and fully rendered if ?action=edit in any of the available uris

Devices and Design (URLs or screenshots, if applicable):

  • Desktop: ...
  • Small screens/mobile: ...

Completion checklist

Related Objects

Event Timeline

gengh updated the task description. (Show Details)

The proper edit link of course is https://wikifunctions.beta.wmflabs.org/wiki/Z10014?action=edit&uselang=en which is what's linked in the tabs, and works. We should check in action is set and redirect the page in the PHP, I suppose.

Change 942451 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/extensions/WikiLambda@master] SpecialViewObject: Don't load if action=edit etc.

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

Jdforrester-WMF changed the task status from Open to In Progress.Jul 27 2023, 9:19 PM
Jdforrester-WMF triaged this task as High priority.

Change 942451 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] SpecialViewObject: Don't load if action=edit etc.

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

Change 942485 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/extensions/WikiLambda@wmf/1.41.0-wmf.19] SpecialViewObject: Don't load if action=edit etc.

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

Change 943516 had a related patch set uploaded (by Genoveva Galarza; author: Genoveva Galarza):

[mediawiki/extensions/WikiLambda@master] Use mw.config JS variables instead of directly URL for edit/view mode

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

Change 942485 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@wmf/1.41.0-wmf.19] SpecialViewObject: Don't load if action=edit etc.

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

Change 943516 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] Use mw.config JS variables instead of directly URL for edit/view mode

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

Now https://www.wikifunctions.org/view/en/Z10000?action=edit redirects to the main page, and not to https://www.wikifunctions.org/wiki/Z10000?action=edit&uselang=en - is that intentional?

(Checked in prod)

The second patch (from Geno) changes it to leave you at the read page; this will go out in the train today, and I think is good enough.