GravityKit / GravityView

The best and easiest way to display Gravity Forms entries on your website.
https://www.gravitykit.com/products/gravityview/
245 stars 63 forks source link

Custom Content fields and custom Date formats are not exported in the /csv/ #1231

Closed rafaehlers closed 5 years ago

rafaehlers commented 5 years ago

A user reported and Toyin was able to confirm (https://debug.gravityview.co/testing/view/products/csv/):

I made a relatively basic table type view with personnalized content fields in it.
Some of these fields have static content and in some I used the gvlogic shortcode to add some logic on certain entrie values.
Here is an example of the logic applied:
[gvlogic if="{Type d'inscription:27}" is="Nouvel adhérent"]
Oui
[else]
Non
[/gvlogic]

I then checked the "Allow CSV acces" in the view options.

The view is working well, all the personnalized content fields are correctly displayed. But when I download the view in CSV format, then the personnalized content disappears. I simply get a blank field instead of the value.
This also happens with the date fields, if I set a specific format, it is respected in the view, but I get the basic database format once in the CSV format.

Tested with GV 2.2.3

┆Issue is synchronized with this Asana task

rafaehlers commented 5 years ago

https://secure.helpscout.net/conversation/740212957/18345/

soulseekah commented 5 years ago

Fixed this particular issue.

This might pop up in later issues as well as CSV hasn't been tested too well. Problem is that all our current fields are HTML-specific. For everything else there's a fallback (field.php or field-csv.php for example). This fallback just outputs the stored value.

I just demoted content and date fields to generic fields (non HTML specific). They contain no HTML. We cannot do this with fields like ratings, since we don't want HTML markup to be exported in CSV. So right now those will be sent as they are stored.

altoin commented 5 years ago

Email field is still linked in CSV even when link the email address is not checked. This appears correctly on the frontend, the link only appears when the data is exported.

Also, if there's more than one custom field in the View, only one field gets exported.

https://debug.gravityview.co/testing/view/products/. There are 3 custom fields in the View

https://secure.helpscout.net/conversation/740212957/18345?folderId=408730

soulseekah commented 5 years ago

Both issues fixed. Please test and let me know.

Also, @altoin please create new tickets instead of reopening old ones, unless it's an old issue. This helps keep new fixes separate and easy to manage.