Closed (duplicate)
Project:
Tamper
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
2 Jul 2019 at 17:03 UTC
Updated:
31 Jul 2025 at 10:07 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
dkosbob commentedComment #3
chegor commentedJust checked that patch works correctly with the latest version of the module
git apply -v rewrite_after_explode-3065458-2.patch
Checking patch src/Plugin/Tamper/Rewrite.php...
Applied patch src/Plugin/Tamper/Rewrite.php cleanly.
Comment #4
jamesdixon commentedThanks.
We should write a test to make sure the rewrite plugin works after the explode plugin as expected.
Maybe something like:
0) Make sure [enemy] token is set to string "ghost"
1) Source is: "Pacman, yellow ghost, red, ghost, blue ghost"
2) Explode into ["Pacman", "yellow [enemy]", "red [enemy]", "blue [enemy]"]
3) Use rewrite to update values to:
4) ["Pacman", "yellow ghost", "red ghost", "blue ghost"]
Comment #5
jamesdixon commentedSorry should be:
Comment #6
tostinni commented@jamesdixon do you have any advice on how to link plugins in tests ?
I tried to write this test but it's not working :
Comment #7
megachrizA fix for this issue is now available in a combination of two other issues:
This ensures that the data of previously applied Tamper plugins (thus before the Rewrite plugin) is written back to the item. The Rewrite plugin then finds the most up to date data on the item.
Among other things, this adds support for arrays for the Rewrite plugin. If your initial source value is for example
Foo,Bar,Quxand you explode that using a comma as separator and then use the Rewrite plugin to add a "x" to it, you'll get["Foox","Barx","Quxx"]instead of["Foox","Foox","Foox"].Closing this as a duplicate now.