From 47c49827abc2d330ab501fc402c047b68b460552 Mon Sep 17 00:00:00 2001 From: Richard Hallett Date: Tue, 14 Jan 2020 14:08:48 +0100 Subject: [PATCH] Strip quotes from name in export --- app/controllers/export_controller.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/controllers/export_controller.rb b/app/controllers/export_controller.rb index 79ee6391a..89f357bc2 100644 --- a/app/controllers/export_controller.rb +++ b/app/controllers/export_controller.rb @@ -251,10 +251,15 @@ def repositories csv = headers.to_csv + # Limit for salesforce default of max 80 chars + name = client.name.truncate(80) + # Clean the name to remove quotes, which can break csv parsers + name.gsub! /["']/, '' + clients.each do |client| client_id = client.symbol.downcase row = { - accountName: client.name.truncate(80), + accountName: name, fabricaAccountId: client.symbol, parentFabricaAccountId: client.provider.present? ? client.provider.symbol : nil, isActive: client.is_active == "\x01",