Can't seem to get anywhere with this module. When I go to node/add/story, an Internal Server Error is thrown for anonymous users.

Comments

Steve Dondley’s picture

Commenting out line 19 fixed it (but the module doesn't work, of course):

$form['register']['form'] = user_register();
matt@antinomia’s picture

Steve, are you using any other modules that alter the user registration form?

Steve Dondley’s picture

Yes, in fact, I was just coming here to report that I'm using node profile. The problem comes time to merge the $extra variable with the $form variable in user_register(). Any ideas on the best way to fix?

Steve Dondley’s picture

This is the output of the $extra variable. Looks like node profile is tacking on a subform:

Array
(
    [registration] => Array
        (
            [#type] => fieldset
            [#title] => User information
            [#collapsible] => 1
            [#weight] => 
            [form] => Array
                (
                    [#type] => subform
                    [#id] => registration_node_form
                    [#arguments] => Array
                        (
                            [0] => stdClass Object
                                (
                                    [uid] => 0
                                    [name] => 
                                    [type] => registration
                                )

                        )

                    [#subform_after_build] => Array
                        (
                            [0] => nodeprofile_integration_adapt_node_form
                        )

                )

        )

    [#attributes] => Array
        (
            [enctype] => multipart/form-data
        )

)

matt@antinomia’s picture

I see... I honestly haven't looked at fago's subform element until just now. The project description says "This form element allows you to reuse existing forms inside your form" so I presume it allows nodeprofile to hijack the user registration page and then inserts the user_register form into the nodeprofile form... Inline_registration works by form_altering itself into the user_register form, so I guess this might be the source of the issue?

It may be possible to rewrite inline_registration as a subform element, which may allow nodeprofile and inline_registration to be friends...

Steve Dondley’s picture

Yeah, it's definitely the source of the issue. If I comment out $form = array_merge($form, $extra); in user.module, I get no error. Of course, I get no nodeprofile fields either.

fago’s picture

hm, I think this generates an endless loop of embeeded forms. You embeed the registration form in the node form, nodeprofile a node form in the registration form. Just don't integrate the registration form in nodeprofiles and it should work.

mavimo’s picture

with node_profile i chage:

$form['register']['form'] = user_register();

to:

$var = user_register();
$form['register']['form']['name'] = $var['account']['name'];
$form['register']['form']['mail'] = $var['account']['mail'];
$form['register']['form']['pass'] = $var['account']['pass'];

bye
Mavimo

livido’s picture

Status: Active » Closed (fixed)