Loading plugins/survey/survey.cpp +11 −2 Changes for plugins/survey/survey.cpp: 11 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -2335,11 +2335,13 @@ namespace blogi { } } if (!sname.empty() && !sxml.empty()) { if (!sname.empty()) { SurveyTemplate tpl; bool parsed = false; if (!sxml.empty()) { // Try JSON first, fall back to XML json_object *jdata = json_tokener_parse(sxml.c_str()); bool parsed = false; if (jdata && json_object_is_type(jdata, json_type_object) && templateFromJson(jdata, tpl)) { parsed = true; } else { Loading @@ -2354,6 +2356,13 @@ namespace blogi { json_object_object_add(jroot, "message_type", json_object_new_string("error")); return jroot; } } else { // Default empty template tpl.id = sname; tpl.title = sname; tpl.description = ""; parsed = true; } // Store as JSON json_object *jtpl = templateToJson(tpl); Loading Loading
plugins/survey/survey.cpp +11 −2 Changes for plugins/survey/survey.cpp: 11 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -2335,11 +2335,13 @@ namespace blogi { } } if (!sname.empty() && !sxml.empty()) { if (!sname.empty()) { SurveyTemplate tpl; bool parsed = false; if (!sxml.empty()) { // Try JSON first, fall back to XML json_object *jdata = json_tokener_parse(sxml.c_str()); bool parsed = false; if (jdata && json_object_is_type(jdata, json_type_object) && templateFromJson(jdata, tpl)) { parsed = true; } else { Loading @@ -2354,6 +2356,13 @@ namespace blogi { json_object_object_add(jroot, "message_type", json_object_new_string("error")); return jroot; } } else { // Default empty template tpl.id = sname; tpl.title = sname; tpl.description = ""; parsed = true; } // Store as JSON json_object *jtpl = templateToJson(tpl); Loading