Hi there,
I just got this error:
Error: Drupal.settings.LoginToboggan is undefined
Source File: sites/all/modules/contrib/logintoboggan/logintoboggan.permissions.js?m0klii
Line: 41This started happening after I enabled the "set password" option and "immediate login".
Just to clarify, this is a javascript error on the browser (firefox) and it's currently blocking other scripts from working.
Let me know if I can post anything that would make this error report more useful.
thanks!
Comments
Comment #1
lucascaro commentedok, this seems to be happening only when editing a field, having field_permissions enabled. But probably the settings should be added whenever the mentioned js file is added?
Comment #2
stevecowie commentedWhat's going on here is that LT overrides the core modules/user/user.permissions.js file with a customized version to alter the default behaviour and allow for the pre-authenticated user role to have permissions assigned. Here's the explanation from the hook_js_alter function:
// If the pre-auth user isn't the auth user, then swap out core's user
// permissions js with LT's custom implementation. This is necessary to
// prevent the pre-auth role's checkboxes from being automatically disabled
// when the auth user's checkboxes are checked.
Seems like the problem here is that the LT behaviour of having an immediate login in combination with a pre-authenticated rule doesn't integrate with setting permissions at field level. I wonder if that's because of the order in which the modules have been installed. You might try altering the module weights so that LT is lighter than the field permissions module to see if that allows LT's hook_js_alter to be called earlier.
Comment #3
j0rd commentedThere's certainly conflicts between field_permissions module and logintoboggan. This is due to the use of the variable "permissions" in both their javascripts & html.
For me, I have a conflict on the "Add New Field" page:
admin/config/people/accounts/fields/FIELD_NAME
Normally when you have "FIeld Permissions" module enabled, and click the "Custom Permissions" radio under "Field visibility and permissions" options, you get some AJAX HTML opening up where you can configure the permissions, but because there's a conflict with the logintoboggan.permissions.js, we don't get this popup.
Here's the JS error I'm getting:
I'm going to create a new ticket for my problem, but I wanted to let this ticket know (because it's a similar problem) that there are other conflicts between these two modules.
Here's my ticket:
#1809616: LoginToboggan & Field Permission modules conflict due to conflicts in variable & CSS ID names.
Comment #4
j0rd commentedI've found other issues related to this now.
I believe most people who run into this bug, is because they have field_permissions (Field Permissions) module installed. Going through and tagging issues and adding keywords into issues, so people can find them.
#1407402: Field permissions reset to default (no access) after updating the field
#1407564: CSS conflict with logintoboggan, prevents using Custom Permissions (field_permissions module)
#1365764: Adding logintoboggan.permissions.js causes error if Drupal.settings.LoginToboggan not set.
Comment #5
md2 commentedHi lucascaro,
I believe the patch over at http://drupal.org/node/1365764#comment-6624824 should fix your issue.
~Mark
Comment #5.0
md2 commentedadded clarification.
Comment #6
dooug commentedDuplicate of #1365764: Adding logintoboggan.permissions.js causes error if Drupal.settings.LoginToboggan not set.