Topic on Extension talk:VisualEditor

Visual Editor + Flagged Rev issue on MW 1.31

10
64.251.40.246 (talkcontribs)

Since I have upgraded the MW from 1.27 to 1.31, clicking the "Edit" now shows "Warning: You are editing an out-of-date revision of this page. If you save it, any changes made since this revision will be lost." if you try to edit a page with the accepted revision (from Flagged Rev)


Back in 1.27, clicking the "Edit" button always displayed the latest (unapproved) version... How can we force Visual Editor to show the latest version?

Ti infotrad (talkcontribs)

As far as I can tell, the VE dev team introduced an (not very well documented ) autosave feature. I was experiencing the same issue as you so I disabled it (sessionStore=false at line 354 in \modules\ve-mw\init\targets\ve.init.mw.DesktopArticleTarget.init.js) and it seems to have fixed it.

64.251.40.248 (talkcontribs)

Thank you for the response - I have disabled the session store but the problem still persists. Do you remember any other changes that you've made along with the line 354 change?

Ti infotrad (talkcontribs)

It worked for me. Did you hard clear your browser cache?

64.251.40.242 (talkcontribs)

Tried in both IE and Chrome with cache cleared - no go. I will try to download fresh copy of the extension and try again

64.251.40.242 (talkcontribs)

Unfortunately changing the sessionstore didn't help my issue. Note that my "Edit" button has the oldid paramter that is forcing the visual editor to display the "approved" version and not the "latest version"


URL Example - *wiki address*/index.php?title=Test&oldid=52301&veaction=edit

Ti infotrad (talkcontribs)

Hmmm, it does not sound like the problem I was experiencing. You would have to look at the code to check why the oldid is tacked to the vedit action in the VE code...

64.251.40.242 (talkcontribs)
Ti infotrad (talkcontribs)

No, I do not use this extension. I would try disabling it to see if you still run into the issue.

64.251.40.248 (talkcontribs)

I've fixed the problem by looking at the MW 1.32 codes for both Visual Editor and Flagged Rev.


For others who are encountering this problem - please see below

  1. Download Visual Editor and Flagged Rev extension for MW 1.32
  2. Copy the following files to your MW 1.31 environment
    1. FlaggedRevs\frontend\FlaggablePageView.php
    2. VisualEditor\modules\ve-mw\int\targets\ve.init.mw.DesktopArticleTarget.init.js


Explanation

  • FlaggedRevision added "wgFlaggedRevsEditLatestRevision" config variable to check if the page you are looking at the is stable or latest version
    • Please see line 1383 and 1384 in the FlaggablePageView.php from MW 1.32
  • Using the newly added "wgFlaggedRevsEditLatestRevision" variable, Visual Editor can now determine if you are looking at the stable or the latest version
    • Please see the line 491 in the ve.init.mw.DesktopArticleTarget.init.js from MW 1.32

I didn't read the entire script and have cause problem. If I find it, I will come back here to mention it.


Also, I will create a simple DL link that fixes both revision and media link issue later today when I get back home

Reply to "Visual Editor + Flagged Rev issue on MW 1.31"