Posted by uwe_a on December 4, 2010 at 4:03pm
4 followers
Jump to:
| Project: | Content Profile |
| Version: | 6.x-1.0 |
| Component: | User registration module |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
When im using content profile, and showing some fields in the registration form, i need a certain field to be unique, so i used unique field module ( http://drupal.org/project/unique_field ), still its not working, this bug report (http://drupal.org/node/951772 ) seems to claim that this is a bug in content profile module . and that its not validating the node before saving when some fields are hidden in the registration form.
Comments
#1
Content profile validates the form, but it only used node_validate() if the whole form included:
See:
if (!in_array('other', content_profile_get_settings($type, 'registration_hide'))) {node_validate($node, $form);
}
elseif (module_exists('content')) {
content_validate($node);
}
Maybe it could be changed to always do a complete node_validate(), but this'd require quite some changes.
#2
fago,
What kind of changes do you think will be needed if we always call node_validate?
All non required CCK fields are anyway listed in "Hide form fields:", if the
auto_nodetitlemodule is installed, the function_content_profile_registration_get_field_selecttakes care of that as well. So the only field would be thebodyfield of the content type, which the "other" setting is hiding.On a simple test setup, I commented the if condition for "registration_hide" and let
node_validatebe called always, it worked.unique_fieldwas able to validate the field and nodebodywas not validated and was not visible as well.What are the situations you think this will fail? I am willing to write up the patch to fix this.
#3
I use content profile module and enabled a content type to be shown on registeration. The problem I am facing is that when there is an validation error on the registeration page, like username already exists, The content type is saved in the database. How is this happening i have no idea about it. Please give me a possible solution.