Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refresh link always disabled on MW 1.35.0 #28

Open
Elteria opened this issue Nov 13, 2020 · 9 comments
Open

Refresh link always disabled on MW 1.35.0 #28

Elteria opened this issue Nov 13, 2020 · 9 comments

Comments

@Elteria
Copy link

Elteria commented Nov 13, 2020

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
Copy link
Contributor

kghbln commented Dec 2, 2020

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

@Hutchy68
Copy link
Owner

Hutchy68 commented Dec 3, 2020

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
Copy link
Contributor

kghbln commented Dec 3, 2020

@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
Copy link
Owner

Hutchy68 commented Dec 3, 2020

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
Copy link
Contributor

kghbln commented Dec 4, 2020

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
Copy link
Owner

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-

  • Purge has always used #ca-purge with the word Purge (this is what was forked in) and I never changed it. @samwilson worked in a JS method, but the original method of action=purge is still there.
  • SMW uses #ca-purge with the word Refresh and a JS method
  • SMW overwrites the method to purge a page in JS and rewrites the content to Refresh

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
Copy link
Contributor

kghbln commented Dec 12, 2020

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
Copy link
Contributor

kizule commented Dec 12, 2020

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

@Hutchy68
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants