Newb question: BASE-URI unbound and phantom navigation

29 views
Skip to first unread message

crazyscottie

unread,
Mar 21, 2011, 11:41:27 AM3/21/11
to weblocks
Hey Weblocks,

I've got a quick-and-dirty login page set up, but after logging in
with valid credentials, I'm receiving the following error (ideally, it
should just display a trivial page, for now):

"UNBOUND-SLOT: The slot WEBLOCKS::BASE-URI is unbound in the object
#<NAVIGATION MAIN-MENU>."

The weirdest part? There are currently no references to make-
navigation or main-menu anywhere in my code. o_O Relevant snippets:

(defun init-user-session (root)
(setf (widget-prefix-fn root) #'render-header)
(setf (widget-suffix-fn root) #'render-footer)
(setf (widget-children root)
(list
(make-instance 'login-maybe
:on-login #'check-login ; check-
login returns successfully, so I know that's okay.
:child-widget 'main-page))))

(defwidget main-page (widget)
((num :initform 10)))

(defmethod render-widget-body ((obj main-page) &rest args)
(slot-value obj 'num))


That's pretty much it. I hoped I'd be able to develop incrementally
by keeping things simple, but it seems the code gods have other
plans. ;-) Thoughts?

crazyscottie

unread,
Mar 21, 2011, 11:45:35 AM3/21/11
to weblocks
Oh, and here's login-maybe, in case it helps, though I think I just
copied that from some tutorial:

(defwidget login-maybe (login)
((child-widget :accessor login-maybe-child-widget
:initarg :child-widget)
(real-child-widget)
(view :accessor login-view
:initform 'login-view
:initarg :view)))

Leslie P. Polzer

unread,
Mar 21, 2011, 11:59:52 AM3/21/11
to weblocks
Hello and welcome!

Please show us the backtrace for that error.

crazyscottie

unread,
Mar 21, 2011, 12:54:45 PM3/21/11
to weblocks


On Mar 21, 10:59 am, "Leslie P. Polzer" <leslie.pol...@gmx.net> wrote:
> Hello and welcome!
>
> Please show us the backtrace for that error.

Thanks, and enjoy!

34 MAP-BACKTRACE

1. #<CLOSURE (LAMBDA (SB-DEBUG::FRAME)) {100583C9C9}>

33 BACKTRACE-AS-LIST

1. 1152921504606846975

32 (FAST-METHOD HANDLE-ERROR-CONDITION (WEBLOCKS-WEBAPP T))

1. #<unavailable argument>
2. #<unavailable argument>
3. #<unavailable argument>
4. The slot WEBLOCKS::BASE-URI is unbound in the object
#<NAVIGATION MAIN-MENU>.

31 (FLET LAMBDA19)

1. The slot WEBLOCKS::BASE-URI is unbound in the object
#<NAVIGATION MAIN-MENU>.

30 SIGNAL

1. The slot WEBLOCKS::BASE-URI is unbound in the object
#<NAVIGATION MAIN-MENU>.

29 ERROR

1. The slot WEBLOCKS::BASE-URI is unbound in the object
#<NAVIGATION MAIN-MENU>.

28 (FAST-METHOD SLOT-UNBOUND (T T T))

1. #<unavailable argument>
2. #<unavailable argument>
3. #<unavailable argument>
4. #<NAVIGATION MAIN-MENU>
5. BASE-URI

27 SLOT-UNBOUND-INTERNAL

1. #<NAVIGATION MAIN-MENU>
2. 8

26 (FAST-METHOD RENDER-NAVIGATION-MENU (NAVIGATION))

1. #<unavailable argument>
2. #<unavailable argument>
3. #<NAVIGATION MAIN-MENU>

25 (FAST-METHOD RENDER-WIDGET (T))

1. #<unavailable argument>
2. #<unavailable argument>
3. #<NAVIGATION MAIN-MENU>

24 (LAMBDA (OBJ &REST ARGS))

1. #<LOGIN-MAYBE "dom0">

23 (FAST-METHOD WITH-WIDGET-HEADER (T T))

1. #<unavailable argument>
2. #<unavailable argument>
3. #<LOGIN-MAYBE "dom0">
4. #<FUNCTION (LAMBDA (WEBLOCKS::OBJ &REST WEBLOCKS::ARGS))
{10043FE7F9}>

22 (FAST-METHOD RENDER-WIDGET (T))

1. #<unavailable argument>
2. #<unavailable argument>
3. #<LOGIN-MAYBE "dom0">

21 RENDER-DIRTY-WIDGETS

20 (LAMBDA ())

19 (FAST-METHOD HANDLE-CLIENT-REQUEST (WEBLOCKS-WEBAPP))

1. #<unavailable argument>
2. #<unavailable argument>
3. #<unavailable argument>

18 (FLET doit-77)

Leslie P. Polzer

unread,
Mar 23, 2011, 2:53:30 AM3/23/11
to weblocks
There's gotta be some code that sets up this main menu thing. Please
grep against your code base, and run (apropos 'main-menu) in your Lisp
image.

Leslie

Scott Helvick

unread,
Mar 23, 2011, 10:19:47 AM3/23/11
to webl...@googlegroups.com

--
You received this message because you are subscribed to the Google Groups "weblocks" group.
To post to this group, send email to webl...@googlegroups.com.
To unsubscribe from this group, send email to weblocks+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/weblocks?hl=en.


Alright, I'm blaming that little snafu on sleep deprivation.  After restarting the webapp today (I *swear* I'd already done that) it told me that the main-page function was undefined, which makes much more sense.  Anyway, here's the main-page function which was previously commented out:

(defun main-page ()
  (make-navigation
    'main-menu
    'log-out (make-logout-button)))

As expected, using that results in the same error as before.

Leslie P. Polzer

unread,
Mar 23, 2011, 11:45:58 AM3/23/11
to weblocks
I don't have the time to explain this in full; please search for "base-
uri" or something similar on this group if you want to know more, this
has been discussed to death before.

Your problem can be fixed by making the login widget not use AJAX.

Leslie

Scott Helvick

unread,
Mar 23, 2011, 4:36:55 PM3/23/11
to webl...@googlegroups.com

 Leslie

--
You received this message because you are subscribed to the Google Groups "weblocks" group.
To post to this group, send email to webl...@googlegroups.com.
To unsubscribe from this group, send email to weblocks+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/weblocks?hl=en.



Heh, I was afraid of that.  After doing some reading, I think I understand what's going on with selectors and AJAX.  However, a couple of bits are still unclear to me.

The login widget.  In a post from Jan. 21, you mention that using the login widget inside of with-flow will trigger the navigation issue -- but I'm not using with-flow or continuations at all, at least not that I know of.  Is it possible to work around the issue just by tweaking login (i.e. not having to use protected-navigation, etc.), and if so, where did I screw that up?

I also saw a thread from Nov. 2009 where it was suggested to redirect or reload the page in on-success.  It looks to me like this is a separate issue (or maybe it was already fixed); relevant or no?

Thanks,
Scott

Leslie P. Polzer

unread,
Mar 23, 2011, 5:04:08 PM3/23/11
to webl...@googlegroups.com

> The login widget. In a post from Jan. 21, you mention that using the login
> widget inside of with-flow will trigger the navigation issue -- but I'm not
> using with-flow or continuations at all, at least not that I know of.

> Is it possible to work around the issue just by tweaking login (i.e. not
> having to use protected-navigation, etc.), and if so, where did I screw
> that up?

Try using a custom login view with :use-ajax-p nil.


> I also saw a thread from Nov. 2009 where it was suggested to redirect or
> reload the page in on-success. It looks to me like this is a separate issue
> (or maybe it was already fixed); relevant or no?

Same issue, and it might work as well in your case.

Leslie

Scott Helvick

unread,
Mar 23, 2011, 7:36:30 PM3/23/11
to webl...@googlegroups.com
Okay, I get it now.  Adding ":use-ajax-p nil" to the login view stopped the JS dialog box, but still resulted in the standard Weblocks error page, which is what's displayed after coming back to a pre-existing session.  So it is one issue, it just shows up in a couple of different places.

FWIW, a redirect accomplishes pretty much the same thing as :use-ajax-p nil, but in a messier way.

So it looks like the only way to have protected selectors is to, well, implement protected selectors.  Unless you've got any better ideas, I'm going to go ahead and do that with the help of those previous posts.  Thanks for all the help you've provided so far.
Reply all
Reply to author
Forward
0 new messages