I'm having this problem. I assigned two content types to use with content profile and i've chosen to show the forms on my registration form (the new feature). The form displays ok for both content types BUT on submit only ONE of the two gets submitted. The data for the second ct is not submitted. If i add the information afterwards it works fine. The issue is the registration form. Probably some bug on submission prevents both content types to be submitted.

Comments

DizzyC’s picture

Status: Active » Needs review
StatusFileSize
new1.86 KB
new739 bytes

OK, since i need this feature to work i took the time and found the problems.
The problems where in the user_register form validation hook. (content_profile_registration_user_register_validate)

I found two errors:

The $node objects where not constructed correctly. Every $node object was given all the field values regardless if the field was of the correct 'type' so all the $node objects created within the foreach loop contained all the fields submitted by the form.

So i simply added an 'if' clause at line 121 so that only the fields belonging to the current $node->type would be copied to the object.

The second problem was when copying the $node object to $form_state, at the end of the validation function (to pass it over to the submit function). It was done by reference (=&$node), so i removed the reference (&) on line 124 and it seems to have done the trick.

Also fixed another minor problem on line 144 where the watchdog() function was not called correctly.

So the affected lines are 121, 124 and 144. I'm attaching a .patch file and also the .module file (to be sure, this beeing my first submitted patch).
I'll also change the status of this issue to (needs review).
Hope it helps.
This is gonna be a great module if u guys keep up the good work.

miro_dietiker’s picture

Hey DizzyC

I'm just wanted to review this patch since it is what i need too...
You should always provide a universal diff - it makes patching much more stable (since -dev is a moving target).
http://drupal.org/patch/create

miro_dietiker’s picture

Status: Needs review » Fixed

I've checked this issue again.. Sorry i can't reproduce it and the patches are no more applicable. content_profile DRUPAL-6--1 differs pretty much and lines don't match anymore and at least two out of three lines make no sense to me in this current context.

Please check with current -dev again, multiple content types are perfectly supported now on registration.

Status: Fixed » Closed (fixed)

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