Support from Acquia helps fund testing for Drupal Acquia logo

Comments

geek-merlin’s picture

Title: Unified login does not honor which form was submitted on validation errors » Unified login shows wrong form on validation errors
Status: Active » Needs review
FileSize
1.07 KB

trivial patch flying in.

additionally this
* redirects you to where you came from after login/register

Soren Jones’s picture

The patch in #1 fixes this bug for me and preserves the destination. Thank you very much.

geek-merlin’s picture

Status: Needs review » Reviewed & tested by the community

so tested

Soren Jones’s picture

Status: Reviewed & tested by the community » Needs work
FileSize
853 bytes

Re: #1

Go to user/register
Click Create new account
The destination is set to user/register

The same issue occurs at user/login with the destination set to user/login.

An updated patch is attached, but could this be handled in JavaScript instead?

EDIT: Don't use the attached patch.

Soren Jones’s picture

geek-merlin’s picture

Status: Needs work » Reviewed & tested by the community

reviewed soren's improvement #5 of my patch #1:
it contains a cure for the pathological case of redirecting to user/login after user/login which is supposed to return "access denied".
same for user/register.
rest is unchanged, so setting to rtbc.

hunmonk’s picture

Status: Reviewed & tested by the community » Needs work

patch no longer applies.

setvik’s picture

Status: Needs work » Reviewed & tested by the community
FileSize
868 bytes

Patch rerolled against master. Nothing else changed. Setting to rtbc.

hunmonk’s picture

Status: Reviewed & tested by the community » Needs work

i don't think i want the destination handling in there, what's the use case? #1172652: Show unified login on Access Denied handles the problem for 403 and preserves destination.

bensey’s picture

Hi there,
is anything happening here? I have the opposite happening to the initial post.
Issue is the same though, it's not returning to the form that was submitted.

Eg.

Create new account with non-matching passwords.
Form fails validation returning to login form with password field highlighted.
User needs to click the 'create new account' button to get back to the correct form and see highlighted fields.

AaronBauman’s picture

Status: Needs work » Needs review
FileSize
1.09 KB

Patch in #8 doesn't work when the form is rendered on 403 pages.
There's no need to involve destination handling whatsoever.
The active form is set with javascript, so the fix is wholly javascript.

AaronBauman’s picture

fixed trailing whitespace

codesidekick’s picture

The patch in #12 works except if a user goes to /user/register, clicks on the log in tab, and doesn't pass the login validation - in that situation they are still redirected to the registration form instead of the failed login form.

The patch attached adds a check on the user form for validation as well using the same method. I made the comment above the check a bit more generic as well to describe both checks.

stevecowie’s picture

Have tested the patch from #13 and confirm it fixes the issue. Could do with another confirmation before committing.

lklimek’s picture

#13 seems to work for me, but I didn't test it thoroughly.

PawelR’s picture

#13 also works for me

Sinan Erdem’s picture

#13 also work for me. I tried many cases, it seems it is working for all.

codesidekick’s picture

Status: Needs review » Reviewed & tested by the community

So marked as reviewed & tested by the community - just need a project maintainer to integrate the patch.

chrisnovak’s picture

#13 works for me. Can get this integrated into the module?

FiNeX’s picture

#13 works for me too. Thanks for the patch. +1 for commit :-)

david_garcia’s picture

#13 works for me too. Thanks for the patch. +1 for commit :-)

Anonymous’s picture

I'm seeing this issue on a site with an address field. When it does the ajax call to update the state/province field (after the user has selected country), it reverts back to the other tab. Is there a way to fix this issue more broadly here or should I submit a new issue?

Edit: yes I tried the patch, but the validation hasn't fired yet when I encounter this issue.

david_garcia’s picture

Issue summary: View changes

@Ryan Weal: Tabs lost after ajax submit is another matter. Check this out: https://drupal.org/node/1342262.

dooug’s picture

Applied patch from comment #13 to the latest 7.x-1.x-dev. This resolved the problem. Many thanks. RTBC++

calebtr’s picture

#13 applies to 7.x-1.x-dev. RTBC++

Anonymous’s picture

Thx 13# worked for me too.

codesidekick’s picture

(from 2 years ago!!!) What's stopping this from being committed?

dooug’s picture

I reached out to @Stevecowie the maintainer, he seems busy and was open to getting assistance in maintaining LT. However, I have not heard back from him since. So it seems this module isn't being maintained until he grants someone else access to do so. I have offered, but haven't heard back.

  • dooug committed 725824f on 7.x-1.x authored by codesidekick
    Issue #1163172 by Soren Jones, aaronbauman, axel.rutz, codesidekick,...
dooug’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

MahmoodZidan’s picture

#13 works. Thanks a lot :)