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

bfroehle’s picture

Hi Matt: Thanks for the report. Can you check and see if this bug also affects 6.x-3.1?

beck24’s picture

Hi Bradley: thanks for responding so quickly, yes this bug is still present in 6.x-3.1

bfroehle’s picture

Given 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?

beck24’s picture

I'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.

  1. Enable CAS
  2. Enable Contact Form
  3. Set permissions for contact form access - anonymous user
  4. Create a site-wide contact form
  5. Visit the contact form while logged out

Additionally you can add the login form as a block so that it renders after the form.

beck24’s picture

I 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

beck24’s picture

Yes, this issue exists for openID as well.

beck24’s picture

And I found that the issue is known for openID: http://drupal.org/node/897794

bfroehle’s picture

Great! 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.

beck24’s picture

Not a problem, my quick fix works for my needs. Hopefully anyone elses if they run into the problem in the meantime.

bfroehle’s picture

Still 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.

bfroehle’s picture

Status: Active » Postponed

Postponed 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.

bfroehle’s picture

Version: 6.x-2.3 » 6.x-3.x-dev

This is still an issue with 6.x-3.x, so I'm updating the version.

bkosborne’s picture

Issue summary: View changes
Status: Postponed » Closed (outdated)

D6 version of the module won't see any further development.