0

Importing into Redactor from a CSV file and we have no control over the formatting. There is a column containing text that is in quote marks but on importing into a Redactor field, any string that contains a comma is treated as a JSON object, so eg:

"Our used vans also come with free MobiloVan roadside assistance, meaning you will not need to pay any additional costs for breakdown cover. As the UK’s largest Mercedes-Benz commercial vehicle franchise Dealer in the UK, Rygor is well positioned to offer extensive expertise and support."

Is being saved as:

screenshot from CMS

How best to save this as a paragraph within Redactor without FeedMe thinking it is a JSON object or interpreting the commas within the string as delimiters?

Craft v 3.6.16 FeedMe v 4.3.6

Cole

5
  • What’s the entire row of the CSV file you’re having issues with? How is the original CSV being output? My guess is it’s not being escaped properly. Jun 13 '21 at 14:32
  • Thanks @RitterKnight - sample row posted at gist.github.com/cole007/86214342b1e3f0a853afb84c04dd26b3 Sample output (in Redactor) come out as: ``` ["Our used vans also come with free MobiloVan roadside assistance","meaning you will not need to pay any additional costs for breakdown cover. As the UK\u2019s largest Mercedes-Benz commercial vehicle franchise Dealer in the UK","Rygor is well positioned to offer extensive expertise and support."] ``` Jun 14 '21 at 8:34
  • Very odd. I grabbed your CSV and popped it into my test Craft install and it worked fine. Are you changing any settings in the feedme config? I had no problems importing. I ran you CSV sample through an online linter and it mentioned "Your CSV appears to be encoded in ASCII-8BIT. We recommend you use UTF-8" but that didn't affect my import. some servers might have issues with that though, which could also explain the \u2019 in place of the apostrophe... Jun 15 '21 at 3:31
  • Some progress on this (at least in looking at the source of the issue). It seems to be only affecting Redactor fields within a Matrix Block. Imagine changing the datadelimiter setting would resolve but we are tied to the formatting of the file supplied (and its formatting) in this instance. Jun 17 '21 at 10:38
  • Your original question didn't mention Matrix blocks at all but I wasn't able to reproduce your problem. Importing into a matrix text block worked just fine on a stock install for me. Must be something with your config? Jun 18 '21 at 17:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.