The admin form in /admin/user/autoassignrole does always set the Default Registration Page state to Yes. That's why the code only checks for the existence of the variable $defaults[$k]['registration'] using isset() whereas it should check for the value of the variable. Since the value is 0 or 1 it can simply be checked as boolean value using '#default_value' => ($defaults[$k]['registration'] ? 1 : 0),

CommentFileSizeAuthor
#1 autoassignrole-808696.patch648 bytesfuerst

Comments

fuerst’s picture

Status: Active » Needs review
StatusFileSize
new648 bytes

Attached patch fixes this issue.

Status: Needs review » Needs work

The last submitted patch, autoassignrole-808696.patch, failed testing.

fuerst’s picture

Don't see any connection of the failed test above to my patch. It fails with messages like A tab named s231859e6is9uZd is pointing to user/s231859bGUwstKW and A menu item named s552495RCdagq6I pointing to /s552495uIGy0wyL exists on the user page.

Any thoughts?

cyberswat’s picture

Status: Needs work » Needs review

Testing bot gets weird sometimes ... let's try again just in case

cyberswat’s picture

Looks like I might need to update the simpletests

troyl’s picture

#1: autoassignrole-808696.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, autoassignrole-808696.patch, failed testing.

fuerst’s picture

Status: Needs work » Needs review

Please do not re-test the patch as long as the simpletests are not updated. Thanks!

codeglyph’s picture

seems to work for me

alioso’s picture

seems to work for me too

scott m. sanders’s picture

This patch works for us thankfully. :)

MaximG’s picture

All right!

MaximG’s picture

#1: autoassignrole-808696.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, autoassignrole-808696.patch, failed testing.

adam_b’s picture

Priority: Normal » Major

Any update on this please?

I'm upgrading the priority as re-setting the default registration page really isn't acceptable.

Anonymous’s picture

I have solved it using the following line to replace the @ line 110 in the 6.x-1.x-dev:

Was:
'#default_value' => (isset($defaults[$k]['registration']) ? 1 : 0),

Replacement:
'#default_value' => (isset($defaults[$k]['registration']) && $defaults[$k]['registration'] == 1 ? 1 : 0),

This seems to solve the problem, as it is something quite basic I imagine that this will also solve the problem in 6.x-1.2.

adam_b’s picture

This seems to have fixed it for me, thanks.

NB: the relevant file is autoassignrole-admin.inc

cyberswat’s picture

Status: Needs work » Closed (duplicate)

Duplicate of #830314: You can not replace the user register page with a node if a path has been designated as the user register page. ... I applied the fix proposed there ... and for the love of whatever you believe could you please learn to submit patches and stop posting code in comments.