Login page - Menu bar does not work

68 views
Skip to first unread message

SR

unread,
Sep 21, 2016, 7:18:11 PM9/21/16
to web2py-users
When I am in the Login page, the menu items does not work.
Any idea why it is not working?
Thanks.

Mathieu Clabaut

unread,
Sep 22, 2016, 3:32:24 AM9/22/16
to web2py-users
The last time it happens to me (menu did not open on click), I had an error in my javascript…
Look at the navigator javascript console…

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

SR

unread,
Sep 23, 2016, 12:00:45 AM9/23/16
to web2py-users
I would really appreciate if you could be more specific?

Anthony

unread,
Sep 23, 2016, 9:36:21 AM9/23/16
to web2py-users
On Wednesday, September 21, 2016 at 7:18:11 PM UTC-4, SR wrote:
When I am in the Login page, the menu items does not work.
Any idea why it is not working?

Not clear how we could know without providing any details at all regarding your code, the exact behavior, and the steps to reproduce the problem.

Jordan Ladora

unread,
Jun 6, 2017, 4:13:26 PM6/6/17
to web2py-users
I notice the same problem.

Using firefox, the js console reveals that web2py-bootstrap3.js is trying to call the function "web2py.validate_entropy", which is in web2py.js, but cannot find it.

The error is:
 ReferenceError: web2py is not defined. (line 14, posn 7 of web2py-bootstrap3.js).

I'm not sure how to make web2py-bootstrap3.js see web2py.js.

Can someone please look into this and post a fix? TY.

Anthony

unread,
Jun 6, 2017, 11:11:26 PM6/6/17
to web2py-users
On Tuesday, June 6, 2017 at 4:13:26 PM UTC-4, Jordan Ladora wrote:
I notice the same problem.

Using firefox, the js console reveals that web2py-bootstrap3.js is trying to call the function "web2py.validate_entropy", which is in web2py.js, but cannot find it.

web2py.validate_entropy in web2py.js is inside a closure, so cannot be accessed in web2py-bootstrap3.js. This is a bug -- the ajax_fields function was copied from web2py.js, and the reference to web2py.validate_entropy was left as is, even though the variable "web2py" is not defined in web2py-bootstrap3.js. You can fix it by changing:

      web2py.validate_entropy($(this));

to:

      $.web2py.validate_entropy($(this));

Note, this problem only arises if you add the IS_STRONG validator to db.auth_user.password.requires (which is not the default). In that case, the PasswordWidget in sqlhtml.py adds a "data-web2py_entropy", which triggers the call to the above line. The reason the menus don't work properly is because the above line breaks the Javascript code.

Anthony

Anthony

unread,
Jun 6, 2017, 11:13:33 PM6/6/17
to web2py-users
Note, this has already been fixed in the master branch, so should be fine in the next release.

Anthony

Jordan Ladora

unread,
Jun 7, 2017, 12:45:14 PM6/7/17
to web...@googlegroups.com
Perfect, thank you.

--
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/JOWoLDKpcaw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages