Page MenuHomePhabricator

Subrules trigger regardless of parent's execution
Closed, ResolvedPublic

Description

Applies to both of the 2 recent versions I tested: 6.1.0.1 SVN 12353 & 6.1.0.2 SVN 12426.

Reproduction:

  1. Create a parent rule to find "find & replace dummy text", and replace with nothing, designed not to execute.
  2. Create a child subrule to regex find ".+", and replace with nothing, which should not execute.
  3. Run. The page is blanked when it should not have been.

This happens regardless of the parent rule's regex & case sensitivity.

Event Timeline

Aklapper triaged this task as Low priority.Feb 10 2023, 12:05 PM
Rjwilmsi claimed this task.
Rjwilmsi subscribed.

For a parent find & replace rule, whether the subrule exectutes isn't controlled by the Find settings, it's controlled by the If/Contains If/Not contains settings.

I have updated F&R documentation here: https://en.wikipedia.org/wiki/Wikipedia:AutoWikiBrowser/Find_and_replace#Advanced_settings

So if you want to find foo to replace with bar and then execute a subrule ONLY if that replacement took place, set the If/Contains to foo also.