CCK: 6.x-2.6
FileField: 6.x-3.3
ImageField: 6.x-3.3
Content Profile: 6.x-1.0
AutoAssign Role: 6.x-1.2

I have a user registration system that uses Content Profile module and auto assign role module. This system allows users to select between two different types of membership. The users are presented with the appropriate form for the type of membership they require. The forms are themed using a theme hook in the template.php file and a form template file.

In every other part of the site, if the CCK imagefield is set as required, the form won't validate unless an image has been uploaded (this includes on the profile node pages if I open them for editing - they won't save unless an image is uploaded). However, at the time of registration, the forms are able to be validated without uploading an image, even though they are set to "required" and 1 image.

I suspect the problem has come from some kind of incompatibility between auto assign role/content profile/imagefield, but have no clue how to find out what is causing the problem or how to fix it.. any suggestions?

Comments

quicksketch’s picture

Priority: Critical » Normal
Status: Active » Fixed

This is a Content Profile issue. See #451654: Filefield upload during registration.

Patroclas’s picture

I am having a similar problem but I do not use Content Profile registration.

If the cck form used to create a Content Profile node does not have the cck imagefield image uploaded, even though the field is set as required, the node is saved with no data. It's OK if an image has been uploaded. Have tested with imagefield set as required/not required but result is same. There are other required text fields in the form but validation is bypassed if the image is not present and no data is saved.

This has been working OK until recent update to filefield 3.5 and CCK 2.7. so not sure which of the modules may have caused the change.

Drupal 6.x-1.7
cck 2.7
Filefield 3.5
Imagefield 3.3
Content profile 1.0
imagecache 2.0 beta10

Patroclas’s picture

I am raising this as a new issue as Iam not sure if it is directly related to this.

Status: Fixed » Closed (fixed)

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

grahamvalue’s picture

Status: Closed (fixed) » Active

The problem still exists

I think the issue is more with content profile than imagefield

grahamvalue’s picture

Here's a sample solution in the meantime that works

function hook_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL)
{
if($node->type == 'profile')
{
if ($node->field_profpic[0]['filesize'] == 0)
form_set_error('field_profpic', t('Please upload a profile picture.'));

}
}

quicksketch’s picture

Status: Active » Closed (fixed)

I'm just guessing, but it looks like you're probably using ImageField with Content Profile, which doesn't work. It's an issue in Content Profile already. See #451654: Filefield upload during registration