Topic on Extension talk:Replace Text

MW 1.35 Replace Text 1.4.1

27
Summary by Kghbln

Required patches were merged:

Issiegainsley (talkcontribs)

Could you help me diagnose this error?

I have run the update.php script.

[5d452609228b03e4bc6380de] /index.php?title=Special:ReplaceText Wikimedia\Rdbms\DBQueryError from line 1699 of D:\inetpub\wwwroot\BDD\includes\libs\rdbms\database\Database.php: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading?

Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTEGER) = old_id) ORDER BY page_namespace, page_title LIMIT 250' at line 1 (localhost) Function: ReplaceTextSearch::doSearchQuery Query: SELECT page_id,page_namespace,page_title,old_text FROM `page`,`revision`,`text`,`slots`,`content` WHERE (old_text LIKE '%business%' ESCAPE '`' ) AND page_namespace = 0 AND (rev_id = page_latest) AND (rev_id = slot_revision_id) AND (slot_content_id = content_id) AND (CAST(SUBSTRING(content_address, 4) AS INTEGER) = old_id) ORDER BY page_namespace, page_title LIMIT 250 Backtrace:

  1. 0 D:\inetpub\wwwroot\BDD\includes\libs\rdbms\database\Database.php(1683): Wikimedia\Rdbms\Database->getQueryException(string, integer, string, string)
  2. 1 D:\inetpub\wwwroot\BDD\includes\libs\rdbms\database\Database.php(1658): Wikimedia\Rdbms\Database->getQueryExceptionAndLog(string, integer, string, string)
  3. 2 D:\inetpub\wwwroot\BDD\includes\libs\rdbms\database\Database.php(1227): Wikimedia\Rdbms\Database->reportQueryError(string, integer, string, string, boolean)
  4. 3 D:\inetpub\wwwroot\BDD\includes\libs\rdbms\database\Database.php(1907): Wikimedia\Rdbms\Database->query(string, string, integer)
  5. 4 D:\inetpub\wwwroot\BDD\includes\libs\rdbms\database\DBConnRef.php(68): Wikimedia\Rdbms\Database->select(array, array, array, string, array)
  6. 5 D:\inetpub\wwwroot\BDD\includes\libs\rdbms\database\DBConnRef.php(313): Wikimedia\Rdbms\DBConnRef->__call(string, array)
  7. 6 D:\inetpub\wwwroot\BDD\extensions\ReplaceText\src\ReplaceTextSearch.php(64): Wikimedia\Rdbms\DBConnRef->select(array, array, array, string, array)
  8. 7 D:\inetpub\wwwroot\BDD\extensions\ReplaceText\src\SpecialReplaceText.php(303): ReplaceTextSearch::doSearchQuery(string, array, string, string, boolean)
  9. 8 D:\inetpub\wwwroot\BDD\extensions\ReplaceText\src\SpecialReplaceText.php(172): SpecialReplaceText->getTitlesForEditingWithContext()
  10. 9 D:\inetpub\wwwroot\BDD\extensions\ReplaceText\src\SpecialReplaceText.php(73): SpecialReplaceText->doSpecialReplaceText()
  11. 10 D:\inetpub\wwwroot\BDD\includes\specialpage\SpecialPage.php(600): SpecialReplaceText->execute(NULL)
  12. 11 D:\inetpub\wwwroot\BDD\includes\specialpage\SpecialPageFactory.php(635): SpecialPage->run(NULL)
  13. 12 D:\inetpub\wwwroot\BDD\includes\MediaWiki.php(307): MediaWiki\SpecialPage\SpecialPageFactory->executePath(Title, RequestContext)
  14. 13 D:\inetpub\wwwroot\BDD\includes\MediaWiki.php(940): MediaWiki->performRequest()
  15. 14 D:\inetpub\wwwroot\BDD\includes\MediaWiki.php(543): MediaWiki->main()
  16. 15 D:\inetpub\wwwroot\BDD\index.php(53): MediaWiki->run()
  17. 16 D:\inetpub\wwwroot\BDD\index.php(46): wfIndexMain()
  18. 17 {main}
Jonathan3 (talkcontribs)

I don't know.

Maybe just comment out the wfLoadExtension( 'ReplaceText' ); line while running update.php.

If it works all right, reintroduce the line and check again.

If it still doesn't work, get the latest extension code and see if that works.

I've not upgraded to MW1.35 yet as it seems that quite a few things don't work with it.

2601:446:4400:700:91F9:3433:1352:6C25 (talkcontribs)

Good to know about 1.35. I will abandon for now.

2601:446:4400:700:91F9:3433:1352:6C25 (talkcontribs)

Thank you!!

Jonathan3 (talkcontribs)

P.S. When I moved my wiki (MW 1.34.1) to a new server (using MW 1.34.4) I had to comment out a few extensions to avoid errors in the update script. Can't remember which. It all worked again fine in the end.

Ciencia Al Poder (talkcontribs)
Peculiar Investor (talkcontribs)
199.247.45.1 (talkcontribs)

We are using MySQL 8

199.247.45.1 (talkcontribs)

8.0.17 to be exact.

Gunnar.offel (talkcontribs)
Ciencia Al Poder (talkcontribs)

The problem is, it won't be fixed if it's not reported properly...

Michele.Fella (talkcontribs)

For MW 1.35, on <yourwikipath> /extensions/ReplaceText/src/ReplaceTextSearch.php

replace the following:

                 $conds = [

                         $comparisonCond,

                         'page_namespace' => $namespaces,

                         'rev_id = page_latest',

                         'rev_id = slot_revision_id',

                         'slot_content_id = content_id',

                         'CAST(SUBSTRING(content_address, 4) AS INTEGER) = old_id'

                 ];

with

                 $conds = [

                         $comparisonCond,

                         'page_namespace' => $namespaces,

                         'rev_id = page_latest',

                         'rev_id = slot_revision_id',

                         'slot_content_id = content_id',

                         'CAST(SUBSTRING(content_address, 4) AS SIGNED) = old_id'

                 ];

Gunnar.offel (talkcontribs)

yeah, this change is what i linked before.

151.21.194.165 (talkcontribs)

@Gunnar.offel you are right, the change is the same! I have the bad habit to troubleshoot low level by myself. Credits to you as you pointed a link before my post!! thanks

Henryfunk (talkcontribs)

The patch works beautifully, thanks.

For what it is worth, this is not an issue with MW1.35 as such, for on my local test installation (MW 1.35 / PHP 7.4.12 / MariaDB 10.4.16), the bug doesn't occur. However, it did occur on my live wiki (MW 1.35 / PHP 7.4.11 / MySQL 5.7.31-0ubuntu0.18.04.1) before I patched it.

MyWikis-JeffreyWang (talkcontribs)

Looks like this is an issue with MySQL 8 then? Got the same issue on MW 1.35.0, PHP 7.4.3, MySQL 8.

Henryfunk (talkcontribs)

No, for it also occurs with MySQL 5.7.31.

Peculiar Investor (talkcontribs)

The developers have fixed it, Gerrit change 631706 but haven't merged it into REL1_35 as far as I can tell.

Kghbln (talkcontribs)

There is no interest in back-porting a merged patch to the 1.35 release branch. If you want to use the extension with MW 1.35 you need to use master.

Peculiar Investor (talkcontribs)

I would have thought that since 1.35 is the long term support (LTS) release branch that it would be standard policy to maintain extensions on the REL1_35 branch as well. Given that Replace Text is a bundled extension with MediaWiki 1.35 this can be problematic for anyone who intends to use MediaWiki 1.35.

While Wiklpedia and all the related wikis run on the master branch, wiki's maintained by others tend to track Version lifecycle which makes NO mention of the master branch. The Special:ExtensionDistributor/ReplaceText by default offers 1.35 (latest stable MediaWiki). The dropdown does allow selection of master (latest development version). Why would you expect someone on the LTS version lifecycle to NOT use the matching extension version?

Please reconsider this decision for the benefit of all. Thank you.

Kghbln (talkcontribs)

Do not get me wrong. This comment was just summarizing reality. I am not the developer of this extension, actually not a developer at all. I just happen to be the first clown who came up with the idea of back-porting this to 1.35 might be a sensible idea. Au contraire, I am all in favour of back-porting to 1.35.

Ciencia Al Poder (talkcontribs)

That's a concerning decision for an extension bundled in the official MediaWiki tarball

Kghbln (talkcontribs)

See my comment above. It was not a decision. I was just the summary after being ignored with the very same question for about a month.

2601:446:4400:700:5513:30C:9B67:52AC (talkcontribs)

I reported this problem. 1_35 is useless to me without this extension.

Kghbln (talkcontribs)

The required patch was now merged into REL1_35. I suppose that this resolved the issue.

@Peculiar Investor: Thanks for bringing momentum back to this issue. I was disillusioned and did not have the power to make a difference.