The jQuery selectors for hiding elements of the login form conflict with the default contact form in drupal 6.22
The contact form has "name" field which is required. When logged out, the CAS jQuery selector sets this field to style="display:none" making the form useless.
Additionally, if the login form is rendered on the contact page after contact form, the name element is visible since the id now renders as "edit-name-1-wrapper"
It is an easy fix however, cas.js line 3
Current:
var $loginElements = $("#edit-name-wrapper, #edit-pass-wrapper, li.cas-link, li.openid-link");
Change to:
var $loginElements = $("#user-login-form .form-item, #edit-pass-wrapper, #user-login-form li, #user-login li");
Comments
Comment #1
bfroehle commentedHi Matt: Thanks for the report. Can you check and see if this bug also affects 6.x-3.1?
Comment #2
beck24 commentedHi Bradley: thanks for responding so quickly, yes this bug is still present in 6.x-3.1
Comment #3
bfroehle commentedGiven the similarity with the OpenID code (cf, openid.js) how is this not a problem for them? Or is there a similar bug report filed against OpenID.module in core?
Comment #4
beck24 commentedI'm not sure, I've never used openID. But judging from that pretty identical code there I imagine they must have the same issue. Could this be a fringe case that hasn't been run into before? It requires having a public facing default contact form.
If you want to test it, it's very easy to replicate.
Additionally you can add the login form as a block so that it renders after the form.
Comment #5
beck24 commentedI just scanned through openID issues and there doesn't appear to be any mention of it, though that module doesn't have any releases beyond Drupal 5 and the install base seems pretty small.
[edit] sorry I didn't realize it had been moved to core - one of those mods I never really pay attention to I guess, I'll give it a test
Comment #6
beck24 commentedYes, this issue exists for openID as well.
Comment #7
beck24 commentedAnd I found that the issue is known for openID: http://drupal.org/node/897794
Comment #8
bfroehle commentedGreat! Thanks for the research. I'd like to wait to commit a fix here until a robust solution is figured out in #897794: OpenID login link can hide the wrong fields.
Comment #9
beck24 commentedNot a problem, my quick fix works for my needs. Hopefully anyone elses if they run into the problem in the meantime.
Comment #10
bfroehle commentedStill waiting on core's #897794: OpenID login link can hide the wrong fields. In the mean time, if anybody would like to translate that patch into something that we can apply to the CAS module I'd be willing to commit it. Remember that we need to account for the possibility of Core + CAS + OpenID all being installed.
Comment #11
bfroehle commentedPostponed until #897794: OpenID login link can hide the wrong fields is resolved. If you want to hurry this along, go pitch in on that issue.
Comment #12
bfroehle commentedThis is still an issue with 6.x-3.x, so I'm updating the version.
Comment #13
bkosborneD6 version of the module won't see any further development.