Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Commas in CSV save format breaks #59

Open
psteiner1 opened this issue Oct 24, 2014 · 7 comments
Open

Commas in CSV save format breaks #59

psteiner1 opened this issue Oct 24, 2014 · 7 comments
Assignees
Labels

Comments

@psteiner1
Copy link

When I use the CSV format to store values for an XML Typeahead, stored values are not properly displayed when a content node is reloaded (e.g. after saving, leaving node, and entering node again).

Changing the save format to JSON fixes this issue.

Note that the CSV format is the only format that facilitates easy data importing (since it does not require the value label in the data set).

@Hendy
Copy link
Contributor

Hendy commented Oct 24, 2014

Hi @psteiner1 the CSV save format was disabled for the Typeahead pickers - the reason for this being that the pool of potential options could be vast and dependent on a supplied typeahead value - so if a CSV format was used, only the IDs would be saved, and it may not be possible to obtain the associated text.

@oooshola
Copy link

Hello,

Thanks so much for this plugin. However I'm experiencing the same problem even if I choose JSON as the save format. I'm using the EnumRadioButtonPicker and I have a class in App_Code as follows:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using nuPickers.Shared.EnumDataSource;

public enum Tints
{
    [EnumDataSource(Key = "rgba(0, 110, 146, 0.8), rgba(0, 110, 146, 0.8)", Label = "Blue")]
    Blue,
    [EnumDataSource(Key = "rgba(191, 30, 6, 0.5), rgba(191, 30, 6, 0.5)", Label = "Red")]
    Red,
    [EnumDataSource(Key = "#2c3e50, rgba(44, 62, 80, 0.8), rgba(42, 70, 98, 0.6), rgba(44, 62, 80, 0.8), #2c3e50", Label = "Midnight")]
    Midnight,
    [EnumDataSource(Key = "rgba(20, 190, 50, 0.5), rgba(20, 190, 50, 0.5)", Label = "Green")]
    Green,
    [EnumDataSource(Key = "rgba(191, 93, 6, 0.5), rgba(191, 93, 6, 0.5)", Label = "Orange")]
    Orange
}

The selected value for my "Tint" property saves correctly and is retrievable in the view, but when I return to the content to edit it again (or refresh the edit page for that content), the selected radio button isn't selected anymore. The same problem happens if I use a dropdown instead of radio buttons.

I'm using Umbraco 7.2beta1 and nuPickers 1.2.1.0.

On another note, the XML save format actually remembers my selected value perfectly, when I return to edit content. However, the XML save format breaks Archetype's JSON data, which is a package I sometimes use. Note: I'm not using the above Tint nuPicker inside Archetype, it's simply directly a property of my "topic page" document type (i.e. I tried to remove as many variables as possible to find what the issue could be).

@oooshola
Copy link

I've figured out why my use case doesn't work with JSON. It's because my keys (which are basically just css rules) have commas in them. a workaround I have is to swap the commas to underscores in the enum strings, and then on the view, swap the commas back in.

@Hendy
Copy link
Contributor

Hendy commented Nov 19, 2014

Hi @oooshola, thanks for pointing that out - will have a look at the JSON encoding to ensure it doesn't break with commas.

@Hendy Hendy changed the title CSV save format breaks selected item display after node reload Commas in CSV, JSON save format breaks Feb 14, 2015
@Hendy Hendy added the bug label Feb 14, 2015
@Hendy Hendy added this to the v1.4.2 milestone Mar 28, 2015
@Hendy Hendy self-assigned this Mar 28, 2015
@Hendy Hendy removed the bug label Apr 26, 2015
@Hendy Hendy modified the milestones: v1.5.0, v1.4.2 May 4, 2015
@Hendy Hendy removed this from the v1.5.0 milestone May 15, 2015
@JimBobSquarePants
Copy link

@Hendy I somehow managed to get a Typeahead converter to have csv as the setting which broke a whole bunch of stuff. v1.5.2

@SayTen
Copy link

SayTen commented Jul 18, 2016

I'm able to setup a Typeahead picker saving as CSV.

nuPickers version: 1.5.3
Umbraco version: 7.4.3
Type: nuPickers.JsonTypeaheadListPicker

Happening today.

@Hendy Hendy changed the title Commas in CSV, JSON save format breaks Commas in CSV save format breaks Apr 4, 2017
@Hendy Hendy added the bug label Apr 4, 2017
@f33n3y
Copy link

f33n3y commented Jan 29, 2019

Hi @Hendy, what is the latest on this issue?
We are using a dotnetcheckbox picker for tags in Umbraco. Any values with commas are not being persisted on save and publish.
Any fixes or workarounds for this?

Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

6 participants