diff options
Diffstat (limited to 'acf/model/init.lua')
-rw-r--r-- | acf/model/init.lua | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/acf/model/init.lua b/acf/model/init.lua index 00fc7aa..1bc190d 100644 --- a/acf/model/init.lua +++ b/acf/model/init.lua @@ -129,7 +129,8 @@ function Reference:meta(context) local txn = context.txn local objs = txn:get( - node.addr(relabel('system', txn.search, txn, res.scope)) + node.addr(relabel('system', txn.search, txn, res.scope)), + 'table' ) or {} res.choice = map(function(p) return pth.join(res.scope, p) end, objs) res['ui-choice'] = objs @@ -209,15 +210,16 @@ Mixed = class(Collection) function Mixed:init(params) params.type = Mixed super(self, Mixed):init(params, node.Mixed) + self.pfield = Field() end function Mixed:load(context) - local value = Primitive.load(self, context) + local value = self.pfield:load(context) if type(value) == 'table' then return super(self, Mixed):load(context) end return value end function Mixed:save(context, value) if type(value) == 'table' then super(self, Mixed):save(context, value) - else Primitive.save(self, context, value) end + else self.pfield:save(context, value) end end |