Topic on Extension talk:Replace Text

"Extension:ReplaceText just reloads" issue (+ solution!)

2
Naupe (talkcontribs)

I administrate a MediaWiki (version 1.31.1) on a Third Party Plesk Server host.

The Replace Text Extension I have installed (version 1.4.1) used to work, and it stopped working after some Domain issues. I had to reset my Plesk Server settings as best from memory as I could, and likely what I think occurred were modified PHP/Apache settings.

The Issue: When I went to the Special:ReplaceText page on my Wiki, filled it out and clicked the Continue button ... the page just reloaded. I was no longer redirected to a page that showed all the pages that would be replaced like I had been before. And in fact, no text replacing was done at all!

The Solution: I got ahold of User:Yaron Koren, one of the authors of this Extension, and he was able to assist me and resolved the issue! Here is the solution for those who may be having the same problem as I had:

  1. Open the SpecialReplaceText.php file in your wiki's extension folder in a Text Editor.
  2. Search for getFullURL() (was on Line 411 for me) and change it to getLocalURL().
  3. On the next line, change 'post' to 'get'.
  4. Search for post (this second instance of post was on Line 576 for me) and change it to get.
  5. On the next line, change getFullUrl() to getLocalUrl().
  6. Save the file.

And viola! My Special:ReplaceText page works like it did before the Domain Issues I had before! No PHP/Apache Settings to update/modify!

I really believe Extension:Replace Text#Known issues ought to include this information. I would add it myself, but I don't really feel like I've done a good job explaining my problem (and I really don't know what triggered it; only a guess on Yaron's part).

Ciencia Al Poder (talkcontribs)

This is probably a problem with your domain setup. You may have a different $wgServer than your actual server, and there's a redirect under the hood, causing POST data being lost.

Typical failures: Your $wgServer is set to http:// but your server is set to automatically redirect all traffic to https://. A similar one is your $wgServer being http://example.com and your webserver is automatically redirecting all traffic to http://www.example.com

You can see this if you open the developer tools (hit F12) and open the network tab. If you make this tab persistent (to not reload on every page load), hitting the submit button will give you a GET or POST request that's replied with a HTTP 301 or HTTP 302 status code, causing the server to reissue the same request again on the new location

Reply to ""Extension:ReplaceText just reloads" issue (+ solution!)"