Skip to content

Commit

Permalink
Label values are lost
Browse files Browse the repository at this point in the history
  • Loading branch information
boutinb committed Nov 9, 2023
1 parent 9f945a9 commit 6cd1f00
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion CommonData/databaseinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1246,6 +1246,9 @@ void DatabaseInterface::labelsLoad(Column * column)
Json::Value originalValueJson;

reader.parse(originalValueJsonStr, originalValueJson);

if (originalValueJson.isNull() && !originalValueJsonStr.empty())
originalValueJson = originalValueJsonStr; // For backward compatibility: in some JASP files the originalValueJson is not a json string but just the original string.

if(column->labels().size() == row) column->labelsAdd(value, label, filterAllows, description, originalValueJson, order, id);
else column->labels()[row]->setInformation(column, id, order, label, value, filterAllows, description, originalValueJson);
Expand Down Expand Up @@ -1277,7 +1280,7 @@ void DatabaseInterface::labelsWrite(Column *column)
{
const Label * label = *labelIter;
const std::string labelDisplay = label->label(),
origValJson = label->originalValueAsString();
origValJson = label->originalValue().toStyledString();


sqlite3_bind_int( stmt, 1, column->id());
Expand Down

0 comments on commit 6cd1f00

Please sign in to comment.