I managed to isolate my problem with the filter down to the use of the FCK Editor. If it is running, no matter how the CSV area is formatted, it doesn't seem to get parsed. Presumably, this is because FCK editor is not sending unformatted line breaks to the filter... Can the filter interpret HTML line breaks as well? I think that would make it compatible with the FCK editor.

Other than that - fine work! For an unmodified text area box, the filter works beautifully!

Comments

ezheidtmann’s picture

StatusFileSize
new466 bytes

Here's a patch that should allow the filter to work with the output from fckeditor. It is untested.

Please test this patch by 1) applying the changes to your installation, 2) checking to see if the problem is solved, and 3) testing other situations, looking for problems this patch might have introduced.

Lucas Gunn’s picture

Hi Clyde,
Thanks for the quick response! Fortunately, it doesn't appear to have introduced any new bugs, however, it still doesn't appear to work from FCK editor boxes. Now I'm stumped. Will follow-up if I either figure out what is causing it, or figure it out...

Thanks.

Lucas Gunn’s picture

Checking through your code, it looks like (please go easy on me, fairly new coder) you are just replacing
with '' - is that right. If so, I think the filter might be looking for text level line endings - in fact, CSVfilter may not be successfully parsing the text from FCK editor, as page output the source for a submitted CSV chunk still looks like this:

[CSV sep=,]
1,2,3,4,5,6,7,8, , 9
9,8,7,6,5,4,3,2, ,1
1,2,3,4,5,6,7,8, , 9
9,8,7,6,5,4,3,2, ,1
[/CSV]

Any thoughts?

ezheidtmann’s picture

StatusFileSize
new496 bytes

My patch removes the <br /> tags after splitting on newline characters. The newline characters must be there (regardless of the presence of br-tags) for the filter to work.

This new patch tackles it another way: it assumes that fckeditor does not insert newlines. Try this one out. Also double-check your filter settings: make sure that csvfilter is actually enabled for the filter you are using with fckeditor.

Lucas Gunn’s picture

Nice work - that seems to have nailed it! Thanks for your help!

ezheidtmann’s picture

That's good to hear.

With the patch applied, does it still work with csv tables written without fckeditor? I'm concerned that my logic for choosing which to split on is incorrect.

Lucas Gunn’s picture

Appears to work fine in a text box without FCK editor as well. Well done!

ezheidtmann’s picture

Status: Active » Reviewed & tested by the community

Ok then. I'll mark this as patch.

axel’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for patch, clydefrog! Patch applied, seems to work ok.

Anonymous’s picture

Status: Fixed » Closed (fixed)