Multiline Find/Replace Adds Carriage Return

Created on 2 January 2025, 18 days ago

Problem/Motivation

I've added a Find replace (multiline) tamper to a Text List field. The text area for the find/replace appears as follows:

0-1 yr|0_1_yr
1-3 yrs|1_3_yrs
3-5 yrs|3_5_yrs
5+ yrs|5_plus_yrs
Not Planned|not_planned
Recently Completed|recently_completed
Deployed|deployed

Unfortunately all but the LAST value are rejected and Feeds Log shows that each of the other values has a replacement of the value above with a carriage return e.g. not_planned/r This is incorrect. Because the widget is a text area with multiple lines, it's important that the carriage return be stripped and that each line be treated as a singular find/replaced unit without the return.

Steps to reproduce

Install Feeds and Feeds Tamper as well as Feeds Log. Add a Feed Type with a Tamper that rewrites multiople values using the Find replace (multiline) plugin. For example, you might have a Text List fields with Labels and Values and the rewrite will rewrite the Label to match a VAlue. Add multiple lines of replacements. Add a Feeds Importer and import values that must be rewritten. Check the Feeds Log upon failure and notice that all but the final line of the Find replace (multiline) will have a carriage return after it.

Proposed resolution

Ensure that carriage returns are stripped out of any value for replacement.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States brooke_heaton

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024