summaryrefslogtreecommitdiffstats
path: root/Sluift
diff options
context:
space:
mode:
Diffstat (limited to 'Sluift')
-rw-r--r--Sluift/ElementConvertors/FormConvertor.cpp4
-rw-r--r--Sluift/Tests/FormTest.lua8
2 files changed, 6 insertions, 6 deletions
diff --git a/Sluift/ElementConvertors/FormConvertor.cpp b/Sluift/ElementConvertors/FormConvertor.cpp
index e44ca3e..9791bfa 100644
--- a/Sluift/ElementConvertors/FormConvertor.cpp
+++ b/Sluift/ElementConvertors/FormConvertor.cpp
@@ -92,7 +92,7 @@ namespace {
}
if (field->getType() == FormField::ListMultiType || field->getType() == FormField::JIDMultiType || field->getType() == FormField::TextMultiType) {
- luaField["values"] = Lua::valueRef(Lua::Array(field->getValues().begin(), field->getValues().end()));
+ luaField["value"] = Lua::valueRef(Lua::Array(field->getValues().begin(), field->getValues().end()));
}
else if (field->getType() == FormField::BooleanType) {
luaField["value"] = Lua::boolRef(field->getBoolValue());
@@ -179,7 +179,7 @@ namespace {
result->setBoolValue(*value);
}
else {
- lua_getfield(L, -1, "values");
+ lua_getfield(L, -1, "value");
if (lua_istable(L, -1)) {
for (lua_pushnil(L); lua_next(L, -2); ) {
if (lua_isstring(L, -1)) {
diff --git a/Sluift/Tests/FormTest.lua b/Sluift/Tests/FormTest.lua
index 7b6b4af..b2ec111 100644
--- a/Sluift/Tests/FormTest.lua
+++ b/Sluift/Tests/FormTest.lua
@@ -59,10 +59,10 @@ assert(public_field['required'] == true)
-- Test multi field
features_field = form['fields'][8]
assert(features_field['name'] == 'features')
-assert(type(features_field['values']) == 'table')
-assert(#features_field['values'] == 2)
-assert(features_field['values'][1] == 'news')
-assert(features_field['values'][2] == 'search')
+assert(type(features_field['value']) == 'table')
+assert(#features_field['value'] == 2)
+assert(features_field['value'][1] == 'news')
+assert(features_field['value'][2] == 'search')
-- Test shortcut index
assert(form['features']['name'] == 'features')