Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I needed to apply a big mapping of 111 values with Find & Replace. I found it useful to have a single tamper that gets a list of all replacements. This patch is not yet good to be committed, needs to be tested and improved, but might be helpful to some people.
Comment | File | Size | Author |
---|---|---|---|
#11 | feeds_tamper-multiple_replace-1525540-11.patch | 2.06 KB | dayures |
| |||
#7 | multiple_replace-1525540-7.patch | 1.66 KB | Lendude |
feeds_tamper-multiple_replace.patch | 1.6 KB | franz | |
|
Comments
Comment #1
xaqroxPatch above worked perfectly for me. Thanks!
Comment #2
xaqroxSo after further testing I ran into a problem. I'm using this tamper on a CSV user import, mapping values from several columns onto a taxonomy field, like this:
As expected, the new users get the updated taxonomy terms. However, terms matching the "source" half of the find & replace multiple pairs are being created too. Haven't had the time to track this down, and it's a one-time import so I can deal with just deleting those extra terms, but this feature isn't quite ready.
Comment #3
irgnet CreditAttribution: irgnet commentedHow to stop replacing after first replace.
If i have in list
Beauty|Health and Beauty
Health|Health and Beauty
The result is
Health and Beauty and Beauty.
Comment #4
franzThat seems out of scope for current implementation. Why don't you try:
Beauty|_TEMPORARY1_
Health|Health and Beauty
_TEMPORARY1_|Health and Beauty
A bit skechy, but I think it works.
Comment #5
irgnet CreditAttribution: irgnet commentedHi,
after update feeds and feed tamper modules this was stopped working
I've got this error when i try to edit find_replace_multiple into UI
Fatal error: Function name must be a string in ..\sites\all\modules\feeds_tamper\feeds_tamper_ui\feeds_tamper_ui.admin.inc on line 459
And
Fatal error: Function name must be a string in ..\sites\all\modules\feeds_tamper\feeds_tamper.module on line 68
when 9 try to import
Comment #6
pauldolphin CreditAttribution: pauldolphin commentedFirst off....A big thank you to @twistor for your hard work and @franz for posting this patch.
Came across this patch while looking for a way to tame all of the find/replace plugins we've needed to put in place with some pretty dirty data provided by a manufacturer that we needed to clean up.
The find/replace plugin is easy enough...the trouble comes when you have more than a few find/replace plugins in place on a given field. The UI just turns into a mess. This plugin looked like the solution...but it isn't playing nice with the latest dev version for feed_tamper.
Anyone out there with mightier coding skills that may be able to help get this plugin working again? Anyone else out there that is having success with this plugin?
Comment #7
Lendude@pauldolphin what wasn't playing nice for you?
Did a small modification to get it running for me with the current version of dev 7.x-1.x. The 'target' needed to be trim()'ed or it would leave a \r and then never find a match so nothing would get replaced.
Other then that it works great so far.
Updated patch added.
Comment #8
thePanz CreditAttribution: thePanz at Liip for FREITAG lab. AG commentedPatch in #7 works fine, thanks!
Comment #9
NWOM CreditAttribution: NWOM commented#7 worked amazingly. Thank you!
Comment #10
dayures CreditAttribution: dayures commentedPlease, find attached another version of the plugin. A checkbox to select if the you want a full comparison. For example:
Original text:
agricultural area
Replace pairs:
area|new area
agricultural area|updated agricultural area
Processed text (full comparison NOT selected)
agricultural new area
Processed text (full comparison selected)
updated agricultural area
Comment #11
dayures CreditAttribution: dayures commentedPlease, find attached another version of the plugin. A checkbox to select if the you want a full comparison. For example:
Original text:
agricultural area
Replace pairs:
area|new area
agricultural area|updated agricultural area
Processed text (full comparison NOT selected)
agricultural new area
Processed text (full comparison selected)
updated agricultural area
Comment #14
tyler-durden CreditAttribution: tyler-durden commentedHas any process been made on this? I need to find/replace on about 100 or so terms on multiple feeds. This would be impossible to do on an in individual plugin line basis.
I'm not a programmer, but can do some testing. I see the last few patches have failed testing?
Comment #15
NWOM CreditAttribution: NWOM commented#7 still applies cleanly to newest dev. I did not test #11 due to it failing the tests currently.
Comment #16
MegaChriz CreditAttribution: MegaChriz as a volunteer commented@NWOM
I think that #11 failed at the time, because branch tests were failing. Indirectly this was caused by Drupal Core adding the permission "administer fields" in a minor version.
Anyway, a new plugin needs tests.