Hey folks, brand new to this module so apologies if I'm just doing something stupid, but it sure looks like some nasty bugs. I'm trying to use my own content type ( I've called it it Custom Profile ) as the user profile content type. This is not a cck based content type, but is built with it's own module in code, following the examples in the Pro Drupal Development book. The content type implements the form, load, delete, update, and insert hooks in its own module, has its own extra table, etc. The custom content type is definitely working fine when not attached to user profiles with the "Use this content type as a content profile for users". The field data is going into my custom table, the forms have correct values in them on edit, I can reedit multiple times, etc.
As soon as I attach it to user profiles by selecting to use this content type for content profile, things get strange:
- the data from the Custom User Profile tabs form goes into the database fine, so far so good
- returning to edit brings up a form with *no* values in any fields ( this was working fine before attaching to content profile )
- entering new data for the same user gets me the following error message: "This user has already a content profile of this type. You can only create one profile per user."
- trying to make a profile for a second user gets me the same error message, without anything ever going into the db, ( neither node table or extra table )
I have checked that I have only one content type selected as the profile content type. Has anyone else been using Content Profile with external content types defined in code with success? Or have any ideas as to whats up above?
Thanks
Iain
Comments
Comment #1
iainduncan commentedI'm not sure what the priority should be. As far as I can tell, this is Critical with regards to external content types in code, but not affecting external content types using CCK. Sorry if I have it wrong.
Comment #2
fagothat should work fine of course. Perhaps you are using parts of the API in a wrong way? Are you using hook load to populate the node's values?
>- entering new data for the same user gets me the following error message: "This user has already a content profile of this type. You can only create one profile per user."
That's intended.
>- trying to make a profile for a second user gets me the same error message, without anything ever going into the db, ( neither node table or extra table )
That shouldn't be the case. Most likely you are overwriting the 'name' field in $_POST with your own one?
It's working right with CCK so I don't think there is a bug in CP - as there is no special code to support CCK. It should work the same way for your own module.