Export_csv truncates content from mediumtext field

A place for users and developers of the Xataface to discuss and receive support.

Export_csv truncates content from mediumtext field

Postby s_nalepa » Sat Apr 25, 2009 10:15 pm

Hi Steve!

I have got a mediumtext field to store item descriptions including html from an htmlarea. There are no problems with storing and viewing quite long descriptions, but after exporting to csv long posts get truncated approx. just before the 256:th character! Where should I look for a restriction?
s_nalepa
 
Posts: 16
Joined: Sat Dec 29, 2007 8:43 am
Location: Lund, Sweden

Postby s_nalepa » Mon Apr 27, 2009 12:36 am

I noticed, that the cutting also occurs in the list view - exactly at same place. But in the detailes view you can see the entire text just as it is stored in the database. So it should be possible to also export the entire text and not just the truncated part from the list view. Please help, it causes huge problems for my collegues while trying to mount the text for a printed catalogue!
s_nalepa
 
Posts: 16
Joined: Sat Dec 29, 2007 8:43 am
Location: Lund, Sweden

Postby shannah » Mon Apr 27, 2009 6:48 pm

What version of Xataface are you using? I seem to recall fixing this issue a while back, but I might be imagining things.
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby s_nalepa » Mon Apr 27, 2009 8:28 pm

I use the 1.1.4 971 version.
s_nalepa
 
Posts: 16
Joined: Sat Dec 29, 2007 8:43 am
Location: Lund, Sweden

Postby s_nalepa » Mon Apr 27, 2009 9:12 pm

On line 1661 in Dataface/Record.php there is a limit for the preview version of a field: $maxlength=255 . This corresponds to the length of the truncated fields. I will try changing this value later today at work. But I don't believe it is the proper way to fix the export - I wonder why/where there is a call to this preview in the export script (if this is the problem).
s_nalepa
 
Posts: 16
Joined: Sat Dec 29, 2007 8:43 am
Location: Lund, Sweden

Postby shannah » Tue Apr 28, 2009 11:47 am

I just checked the logs in SVN and it appears that this was fixed about a year ago and there have been several versions since (I think your version should be current enough).

Is this happening when you export from list view? Or is it only for related record tabs? (i.e. is it in the "list" tab, or a sub-tab of the "details" tab?)
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby s_nalepa » Tue Apr 28, 2009 9:32 pm

It happens when I export from a list view. The affected field is in the main table. The list view is filtered on a field in the main table through the url.

I have made a temporary solution by tweaking the export to xml so I can get the contents from the source view of the web page with the xml result, I put tabs and newlines instead of xml tags. The export to xml does not truncate the posts with long content, but I have to replace all html-entities myself and remove blank lines.

Changing the $maxlength variable in Record.php did not make any difference.

There is obviously a difference in how the export to xml and the export to csv work, besides the fact that export to csv writes to a file. But I can't find the difference in how the database is queried, or anything else that affects the result.
s_nalepa
 
Posts: 16
Joined: Sat Dec 29, 2007 8:43 am
Location: Lund, Sweden

Postby shannah » Wed Apr 29, 2009 7:29 am

You should try at least downloading the latest version of xataface and see if that clears it up. I can't reproduce this. I export to CSV - some cells contain many many pages of information.
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 18 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved