Hutchy68 / Purge

MediaWiki Purge Extension
GNU General Public License v2.0
8 stars 7 forks source link

Refresh link always disabled on MW 1.35.0 #28

Open Elteria opened 3 years ago

Elteria commented 3 years ago

It looks like the refresh link is always disabled on MediaWiki 1.35.0. Aswell confirmed on the talk page of the extension.

https://www.mediawiki.org/wiki/Topic:Vvfthnqa2g5san3o

kghbln commented 3 years ago

@Hutchy68 See here on how this was fixed for SMW: https://github.com/SemanticMediaWiki/SemanticMediaWiki/pull/4881 Probably no need to re-invent the wheel.

Hutchy68 commented 3 years ago

Thanks @kghbln

I’m thinking I might just rip out the JS and go back to what was and always has worked... action=purge. I was not and still not a fan of relying on JS to do the page purge.

kghbln commented 3 years ago

@Hutchy68 My understanding is that the JS is here to prevent second confirmation which is required by MediaWiki. However having at least an extra button instead of using the address field of the browser to type in action=purge is good enough for me.

Hutchy68 commented 3 years ago

No there is the purge permission to skip the extra button. It’s only for public and bots to require the extra step. That is if you want to turn it on and by all means you should for bots and unregistered users.

kghbln commented 3 years ago

Ah, admittedly I believed that this one was gone - interesting. Anyhow, it will be great to get this extension up and running for MW 1.35 again. :)

Hutchy68 commented 3 years ago

refresh link is always disabled on MediaWiki 1.35.0

Hi @kghbln and @Elteria, this extension is being confused with a website running SMW. In an install without SMW, the purge extension works with MW 1.35 without issue. It just does not do it with JS, it uses the action=purge method, load confirmation page, click button, done. In other words, it gracefully falls back from JS to the hard loading function to purge a page.

So the issue is Semantic MediaWiki is stepping on the Purge extension. I do not know what came first, but the Purge extension looks like it was started 9 May 2009. There is no previous history as the code was (sorry) purged from the project after I forked it into GitHub in early 2016 (almost 5 years ago).

So the issue is in the element #ca-purge-

I did some testing on the extension by changing the element to #ca-purge-test and both show up.

image

Without the change

image

Both work with JS in MW <= 1.34. There are two things to solve for MW 1.35.

  1. Purge vs Refresh and SMW stepping on the ca-purge element
  2. Fixing Purge to do an in place purge with JS.

@samwilson it looks like mw.notify() can now be called directly in MW 1.35 without wrapping mediawiki.notify in the resource loader. PR #29. Fixes 2. but not 1.

kghbln commented 3 years ago

Now that this was sorted out for SMW I still do not know if the Purge extension works for MW 1.35 or not. :) From the second pic it appears that it does not, no?

kizule commented 3 years ago

@kghbln As I see, #29 makes this extension working on this version. 😄

Hutchy68 commented 3 years ago

If you install purge extension without SMW and use my PR #29 it works on MW 1.35 with JS. If someone has JS disabled, it falls back and still works.

If SMW is installed, SMW overwrites the element the Purge extension creates.