Topic on Extension talk:Replace Text

ArchATempAcct (talkcontribs)

I am trying to delete all category links where the category ends with the word "cross".

I am using: (?i)\[\[:?Category:([a-z0-9]+)cross\]\] with a blank replacement string. What am I screwing up? I would really like to remove all category links with the word "cross" anywhere in them, but I am not ready to tackle that yet.

Ciencia Al Poder (talkcontribs)

Looks like your search input should work (unless the category has spaces anywhere between brackets)

ArchATempAcct (talkcontribs)

Database error

Jump to navigation Jump to search

A database query error has occurred. This may indicate a bug in the software.

[ZcgnAl4fIWg2gKD_Lb8zrAABvVQ] /index.php/Special:ReplaceText Wikimedia\Rdbms\DBQueryError: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading or after adding a new extension?


Please see https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Upgrading and https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:How_to_debug for more information.


Error 1139: Got error 'repetition-operator operand invalid' from regexp

Function: MediaWiki\Extension\ReplaceText\Search::doSearchQuery

Query: SELECT page_id,page_namespace,page_title,old_text,slot_role_id FROM `mwfp_page`,`mwfp_revision`,`mwfp_text`,`mwfp_slots`,`mwfp_content` WHERE (old_text REGEXP '(?i)\\[\\[:?Category:([a-z0-9]+)cross\\]\\]') AND page_namespace = 0 AND (rev_id = page_latest) AND (rev_id = slot_revision_id) AND (slot_content_id = content_id) AND (CAST( SUBSTR(content_address, 4) AS SIGNED ) = old_id) ORDER BY page_namespace, page_title LIMIT 1000

Backtrace:

from /home4/rabidpan/public_html/fascipedia/includes/libs/rdbms/database/Database.php(1618)

#0 /home4/rabidpan/public_html/fascipedia/includes/libs/rdbms/database/Database.php(1602): Wikimedia\Rdbms\Database->getQueryException(string, integer, string, string)

#1 /home4/rabidpan/public_html/fascipedia/includes/libs/rdbms/database/Database.php(1576): Wikimedia\Rdbms\Database->getQueryExceptionAndLog(string, integer, string, string)

#2 /home4/rabidpan/public_html/fascipedia/includes/libs/rdbms/database/Database.php(952): Wikimedia\Rdbms\Database->reportQueryError(string, integer, string, string, boolean)

#3 /home4/rabidpan/public_html/fascipedia/includes/libs/rdbms/database/Database.php(1711): Wikimedia\Rdbms\Database->query(string, string, integer)

#4 /home4/rabidpan/public_html/fascipedia/includes/libs/rdbms/database/DBConnRef.php(103): Wikimedia\Rdbms\Database->select(array, array, array, string, array)

#5 /home4/rabidpan/public_html/fascipedia/includes/libs/rdbms/database/DBConnRef.php(326): Wikimedia\Rdbms\DBConnRef->__call(string, array)

#6 /home4/rabidpan/public_html/fascipedia/extensions/ReplaceText/src/Search.php(66): Wikimedia\Rdbms\DBConnRef->select(array, array, array, string, array)

#7 /home4/rabidpan/public_html/fascipedia/extensions/ReplaceText/src/SpecialReplaceText.php(334): MediaWiki\Extension\ReplaceText\Search::doSearchQuery(string, array, string, string, boolean)

#8 /home4/rabidpan/public_html/fascipedia/extensions/ReplaceText/src/SpecialReplaceText.php(183): MediaWiki\Extension\ReplaceText\SpecialReplaceText->getTitlesForEditingWithContext()

#9 /home4/rabidpan/public_html/fascipedia/extensions/ReplaceText/src/SpecialReplaceText.php(82): MediaWiki\Extension\ReplaceText\SpecialReplaceText->doSpecialReplaceText()

#10 /home4/rabidpan/public_html/fascipedia/includes/specialpage/SpecialPage.php(701): MediaWiki\Extension\ReplaceText\SpecialReplaceText->execute(NULL)

#11 /home4/rabidpan/public_html/fascipedia/includes/specialpage/SpecialPageFactory.php(1428): SpecialPage->run(NULL)

#12 /home4/rabidpan/public_html/fascipedia/includes/MediaWiki.php(316): MediaWiki\SpecialPage\SpecialPageFactory->executePath(string, RequestContext)

#13 /home4/rabidpan/public_html/fascipedia/includes/MediaWiki.php(904): MediaWiki->performRequest()

#14 /home4/rabidpan/public_html/fascipedia/includes/MediaWiki.php(562): MediaWiki->main()

#15 /home4/rabidpan/public_html/fascipedia/index.php(50): MediaWiki->run()

#16 /home4/rabidpan/public_html/fascipedia/index.php(46): wfIndexMain()

#17 {main}

ArchATempAcct (talkcontribs)

That error message disappeared when I ran the update script, so no worries there. So we are back to the spaces. How do I get it to see categories with spaces in them?

Ciencia Al Poder (talkcontribs)

This should work: (?i)\[\[[ :]*Category:([a-z0-9 ]+)cross *\]\]

Note that (?i) may not be supported on mariadb REGEXP

ArchATempAcct (talkcontribs)

RESOLVED.

A (.*) on each side of "cross" did the trick.

Reply to "category"