location issue after version 3.0-M6 and with -Drun.mode=production

42 views
Skip to first unread message

sebi...@gmail.com

unread,
May 11, 2016, 1:12:55 PM5/11/16
to Lift
Hi,

I refrained for some time to upgrade from "3.0-M6", because newer versions cause some issues in my code when running the application with -Drun.mode=production.

The function that leads to problems is:

def templateId: Box[Int] = S.location match {
case Full(loc) => loc.currentValue match {
case Full(lib.sitemap.VisibleTemplate(t)) if t.id.isDefined => Full(t.id.get)
case _ => Empty
}
case _ => Empty
}

This function would usually return a Full[Int], however when run in production mode in some cases it returns Empty. Works as expected in the default mode.

Do you know immediately what might be the issue or suggest an alternative way to achieve the same result?

Thanks in advance!

Sebastian

Antonio Salazar Cardozo

unread,
May 11, 2016, 1:22:53 PM5/11/16
to Lift
Interesting. Not off the top of my head. Do you know where the `Empty` starts
happening? That is to say, is it S.location that is empty, loc.currentValue, or
Thanks,
Antonio

sebi...@gmail.com

unread,
May 11, 2016, 1:44:20 PM5/11/16
to Lift
Hi Antonio,

it's the loc.currentValue:

19:26:44.635 [qtp1660291377-157] ERROR code.snippet.Editor - S.location: Full(Loc(template, <function1>, LinkText(<function1>), List(If(<function0>,<function0>), MatchWithoutCurrentValue, IfValue(<function1>,<function0>), IfValue(<function1>,<function0>))))
19:26:44.635 [qtp1660291377-157] ERROR code.snippet.Editor - loc.currentValue

Kind regards,
Sebastian

sebi...@gmail.com

unread,
May 12, 2016, 2:55:43 AM5/12/16
to Lift
One more hint: this issue occurs in case of pages containing nodes rendered by snippets that run inside lazy-load snippets. Removing the data-lift attribute that triggers lazy-load snippet seems to solve the issue. Does anyone know what change after 3.0-M6 might have caused this?

sebi...@gmail.com

unread,
May 12, 2016, 6:12:49 AM5/12/16
to Lift
it looks like it is related to the use of MatchWithoutCurrentValue and checking


there were some changes related to this.

When I remove in my menu the use of MatchWithoutCurrentValue all seems to work fine


def menuConstructor = Menu.params[TemplateAccess]("template", "Template",  parse, encode) / "template" / ** >>
loggedIn >>
//MatchWithoutCurrentValue >>
existentResource >>
visibleResource

Antonio Salazar Cardozo

unread,
May 17, 2016, 10:08:36 PM5/17/16
to Lift
What's puzzling to me is why this shows up only in production mode… Are you
certain that that's the case?

Any chance you can post an example project (https://www.assembla.com/wiki/show/liftweb/Posting_example_code)?
Thanks,
Antonio
Reply all
Reply to author
Forward
0 new messages