Closed (outdated)
Project:
Views Bonus Pack
Version:
6.x-1.0-beta4
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
29 Jan 2009 at 13:10 UTC
Updated:
8 Mar 2023 at 20:38 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
alex.k commentedIt is probably directly related to how Views formats these fields. Taxonomy does use a configurable delimiter, whereas multi-valued CCK fields would be rendered with < ul>< li>value< /li>.... - so markup is stripped and we end up with just text in CSV.
Comment #2
neclimdulThat explains a lot. I was never sure what that issue was trying to do.
I'll see if there's something we can do.
Comment #3
amanire commentedHas there been any progress on this issue? Currently, it is concatenating values without any separation.
Comment #4
amanire commentedI am recategorizing this as a bug, since concatenating values without any separation renders the output difficult to read and impossible to analyze in an application like Excel.
Comment #5
servantleader commentedHas anyone found a work around for this issue or anything that will work?
Comment #6
gintass commentedSubscribing
Comment #7
MixologicSubscribing
Comment #8
dieter commentedhi, I fixed this in D6 as follows (probably not the cleanest way to do this, but it works)
Comment #9
Branndon commentedWhere do I paste that?
Comment #10
dieter commentedJust replace the function in modules/views_bonus/ export/views_bonus_export.module
Comment #11
neclimdulI'm trying to work something out for this along with #552172: Accept fields that render XML node structure.
Comment #12
sayuri commentedThanks so much for that solution, dieter. It works perfectly for me in D5.18 with Views Bonus v5.x-1.2-alpha2. In that case, you need to insert the code in modules/views_bonus/views_bonus_export.module as below:
Comment #13
grguth commentedSubscribing
Comment #14
BetaTheta commentedsubscribing
Comment #15
sphopkins commentedThis patch works on my web app. Hope it makes it into the full release eventually.
Comment #16
alex.k commentedThe fix in #8 works for D6, thank you very much for posting.
Comment #17
lukusThe fix in #8 has helped me too .. thanks.
I'm a bit concerned that I've had to alter the module directly. Is there any chance of this functionality being build into a release?
Comment #18
alex.k commented@lukus - you can put this function in your theme's template.php, just call it themename_preprocess_views_bonus_export_csv()
Comment #19
lukus@alex.k, thanks for the heads-up I'll make sure I do that.
Comment #20
neclimdulmerging into #552172: Accept fields that render XML node structure
Comment #21
dafederSince discussion at http://drupal.org/node/552172 is still purely XML-related I'm posting this here. #8 didn't work for me, it removed some of my field-delineating quote marks and rendered the CSV file unreadable. This modification worked for me (added and renamed in theme template.php). $delimeter can of course be any character(s) you want.
Comment #22
neclimdulI'm not going to commit that as it doesn't provide for rows that legitimately have divs that are not multiple cck fields. Its just not going to happen.
However there is actually a subtle difference now that I remember the other issue better so I'm reopening this. This patch is just closely dependent on a fix to #552172: Accept fields that render XML node structure as I'll explain later.
I've attached a patch that kinda shows an approach I'm interested in working with. Where the other issue comes into play is when the plugin version of the theme function gets called and provides some sort of html/xml/etc structure, its still going to be stripped out.
So, this patch doesn't fix this issue yet but I do want some feedback on how it would for people.
Approach summary(for non patch readers)
We provide a CCK formatter you would choose for the field. This would most likely be override the formatter for the default display so the HTML version of the view would use the normal formatter. Maybe we provide some fallback method for non views export display styles, this is already sort of supported by the patch. Then using a proxy theme function we'll provide a number of theme function alternatives matching a pattern. I think the code setting up the pattern is pretty self explanatory as to the pattern:
where $type is a magic export plugin value like csv, xml, xls, doc.
So, each plugin would have some basic fallback code for providing multiple field rendering and then further site specific customization can be done at the theme layer if needed and follows a theme setup that should be familiar to views developers.
Comment #23
boabjohn commentedHowdy:
I have applied the patch of #22 to my views_bonus/export install and got success for hunk 2.
I might be missing the concept though as it would seem if you're going to provide some modification as a cck formatter, wouldn't that need to be patched against cck? At any rate, opening the content type>cck field in question I don't see a new formatter option as a result of the patch.
And the View still shows multiple values concatenated.
So: not sure why this has been sitting idle for so long...it would seem like a pretty core aspect of functionality.
The strategy outlined above seems reasonable to me, although I don't quite get how you plan to reach over into cck world from a Views plugin.
FWIW it seems like you could hook into the native Views process that knows about "Grouping" multiple values and just extend the idea with a new option: "Choose Delimiter for Multiple Values"
No idea what that might involve, but I just note that the logic for single vs multiple values seems to be already partially available.
In any event:
Thanks for the module and your work. Looking forward to a productive resolution asap.
Comment #24
ahabman commentedI must have an updated version of the module. Doing a straight copy and paste of #8 built a blank csv. To apply the patch from #8 to version "6.x-1.1" I ended up with the following.
Comment #25
islandlinux commentedSubscribing
Comment #26
kazah commentedsubscribing...
Comment #27
neclimdul