# HG changeset patch # User bsw # Date 1546884990 -3600 # Node ID ce812dccaac2a081ec8864351d4976903dc8a173 # Parent ad1107fc0fbfed13830213c85fec4b43bcb5d875 Work without configured profile fields diff -r ad1107fc0fbf -r ce812dccaac2 app/main/member/_profile.lua --- a/app/main/member/_profile.lua Mon Jan 07 19:15:42 2019 +0100 +++ b/app/main/member/_profile.lua Mon Jan 07 19:16:30 2019 +0100 @@ -37,9 +37,11 @@ end if member.profile then local profile = member.profile.profile or {} - for i, field in ipairs(config.member_profile_fields) do - if profile[field.id] and #(profile[field.id]) > 0 then - ui.field.text{ label = field.name, name = field.id, value = profile[field.id] } + if config.member_profile_fields then + for i, field in ipairs(config.member_profile_fields) do + if profile[field.id] and #(profile[field.id]) > 0 then + ui.field.text{ label = field.name, name = field.id, value = profile[field.id] } + end end end end diff -r ad1107fc0fbf -r ce812dccaac2 app/main/member/edit.lua --- a/app/main/member/edit.lua Mon Jan 07 19:15:42 2019 +0100 +++ b/app/main/member/edit.lua Mon Jan 07 19:16:30 2019 +0100 @@ -27,16 +27,17 @@ ui.container{ content = _"All fields are optional. Please enter only data which should be published." } - for i, field in ipairs(config.member_profile_fields) do - ui.container{ - attr = { class = "mdl-textfield mdl-js-textfield mdl-textfield--floating-label" }, - content = function() - ui.tag{ tag = "input", attr = { class = "mdl-textfield__input", name = field.id, id = "input_" .. field.id, readonly = config.locked_profile_fields[field.id], value = profile and profile.profile and profile.profile[field.id] or nil } } - ui.tag{ tag = "label", attr = { class = "mdl-textfield__label", ["for"] = "input_" .. field.id }, content = field.name } - end } - slot.put("
") + if config.member_profile_fields then + for i, field in ipairs(config.member_profile_fields) do + ui.container{ + attr = { class = "mdl-textfield mdl-js-textfield mdl-textfield--floating-label" }, + content = function() + ui.tag{ tag = "input", attr = { class = "mdl-textfield__input", name = field.id, id = "input_" .. field.id, readonly = config.locked_profile_fields[field.id], value = profile and profile.profile and profile.profile[field.id] or nil } } + ui.tag{ tag = "label", attr = { class = "mdl-textfield__label", ["for"] = "input_" .. field.id }, content = field.name } + end } + slot.put("
") + end end - if not config.enforce_formatting_engine then ui.field.select{ label = _"Wiki engine for statement",