Impossible to override MongoMapField.toForm

28 views
Skip to first unread message

Clement Delafargue

unread,
Jun 6, 2011, 5:02:00 PM6/6/11
to lif...@googlegroups.com
Hi everyone,

I'm building an app where I use extensively mongodb-record, and I face a little problem.
One of my fields inherits from MongoMapField, and I'd like to override (amongst other things) its toForm method.

The problem is that toForm is defined as follows:

def toForm = Empty //FIXME

So it's impossible to override it with anything other than a method returning Empty.

This issue was also present with MongoListField, but it has been fixed in commit https://github.com/lift/framework/commit/2f72d8cf7efadbafb1656ad6bb02fd896cdd1a46

MongoCaseClassField, MongoCaseClassListField and PatternField are affected as well.

I'm still new to Lift, so I don't know if it was made on purpose or if it's been forgotten. (the FIXME comments and the fact it has been fixed for MongoListField make me think it's the second option)

The fix is not complicated to write (just tell the compiler the method should return Box[NodeSeq]), I've already written it (https://github.com/divarvel/framework/commit/2356199bfea3db26f3854d83e7c55d3c63b2436c,https://github.com/divarvel/framework/commit/ba4a0e9b47f1758ad32e78af7ecb034138f928a7 and https://github.com/divarvel/framework/commit/5ed34281fcc0074a06b9f1f6803252be6faff844)


Tim Nelson

unread,
Jun 6, 2011, 5:30:12 PM6/6/11
to lif...@googlegroups.com
Hi Clement,

Please file a ticket and I should be able to get these fixed tomorrow.

Tim

Clement Delafargue

unread,
Jun 6, 2011, 5:54:22 PM6/6/11
to lif...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages