Publisher does not support the Fluid field type. Please do not contact asking when support will be available.

If you purchased an add-on from expressionengine.com, be sure to visit boldminded.com/claim to add the license to your account here on boldminded.com.

Ticket: Wysiwyg data importing into Grid column behaves differently vs standalone wysiwyg field

Status With Customer
Add-on / Version DataGrab 5.0.2
Severity
EE Version 7.2.11

Foster Made

May 19, 2023

Hey Brian, I found another issue while testing 5.0.2 (thanks for that btw!).  Some of the data we need to import is wysiwyg content and the client is copying and pasting data from their catalog data and pasting it into the spreadsheet, which has line-breaks in the content.  Exporting it to CSV loses the formatting as we’d expect, but the issue is that if the data is imported into a Wygwam field inside a Grid, everything after the first line-break gets stripped, whereas this doesn’t happen if the exact same column in the CSV is imported into a standalone Wygwam field.  See screenshots attached and if you need the CSV it’s at https://store.lab-aids.com/temp/kits-test-import.csv

I tried manually replacing the line-breaks in the CSV with
and that sort of helped, but then the commas in the content were causing the data to be split across multiple Grid rows.

Is it possible to fix this so the import into the Grid column Wygwam fields acts the same as the standalone Wygwam field?  Thanks!

#1

BoldMinded (Brian)

May 19, 2023

Try this change in the dt.datagrab_csv.php file, on line 263.

Change this

return trim($sub_items[$this->sub_item_ptr - 1]);

to this

return trim(stripcslashes($sub_items[$this->sub_item_ptr - 1]));

 

#2

Foster Made

May 19, 2023

Comment has been marked private.

#3

BoldMinded (Brian)

May 19, 2023

This doesn’t make much sense, DataGrab doesn’t care that it’s a wysiwyg field, it just sees it as a text field. Does this happen to other entries? The screenshots show a line of text followed immediately by a <ul>, what happens if it’s not html and just a line break?

#4

Foster Made

May 22, 2023

Comment has been marked private.

#5

BoldMinded (Brian)

May 22, 2023

This isn’t a Wygwam/RTE issue, it happens if importing into a Textarea field inside of Grid too. Still no clue why…

#6

BoldMinded (Brian)

1 day ago

There is a stripcslashes function call on line 92 of AbstractDataType.php… try removing it and see if it makes a difference. Change it to

return trim($items[$id]);

Login to reply