Topic on Extension talk:Replace Text

Jump to navigation Jump to search

Extension doesn’t work after upgrading to MW 1.35

Summary last edited by Kghbln 12:04, 2 October 2020 1 year ago

Resolved: need to change a line in ReplaceTextSearch.php // Moreover reported with task T264433.

Fokebox (talkcontribs)


I have updated my Wiki from 1.29 to 1.35 and installed the extension. When I try to use it I see the following error:

MySQL error in ReplaceText extension

Can you please help me to resolve this problem?

Translation of the error: [X3Wfcvven95FpnAv0QBJhQAAAQo] 2020-10-01 09:20:50: fatal exception of the type "Wikimedia\RDBMS\Dbqueryerror»

HerrHulaHoop (talkcontribs)

Had a similar issue. My teammate tracked it down to commit bcd6b2f732824d26a55ff3892442e143df7994a6 causing the issue. We use MySQL 5.6 and there's no evidence that it actually supports CAST AS INTEGER. Reversing that commit can fix the issue till the developers fix it in the mainline versions. I can't link to the commit since the spam filter gets activated.

Fokebox (talkcontribs)

Here it is what I have for my Wiki:

Product Version
MediaWiki 1.35.0
PHP 7.4.10 (cgi-fcgi)
MySQL 5.7.27-30
ICU 50.1.2
Lua 5.1.5

If it helps to understand what causing the error.

HerrHulaHoop (talkcontribs)

You need to physically edit a file in your replace text extension:

  • Go to /src/ReplaceTextSearch.php
  • Edit line 54 from 'CAST(SUBSTRING(content_address, 4) AS INTEGER) = old_id' to 'CAST(SUBSTRING(content_address, 4) AS SIGNED) = old_id'
  • Save it and try again.

Hope this helps!

Fokebox (talkcontribs)

Works perfectly! Thank you!