Problem with profile fields save system

zmove - June 14, 2008 - 10:35
Project:Drupal
Version:6.x-dev
Component:profile.module
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed
Description

Hi,

I noticed what It seems to be a bug with Drupal 6 and the profile system.

I have an action that save some profile hidden field depending on others visible field that the user fill when it edit his account.

Look especially to the end of code of my action :

<?php
  drupal_set_message
('<pre>'.print_r($fields, true).'</pre>');
 
drupal_set_message('<pre>'.print_r(user_save($updated_user, $fields), true).'</pre>');
?>

And look now the output when the action is triggered :

Output of $fields

#

Array
(
    [profile_api_status] => Error
    [profile_charname1] =>
    [profile_charid1] =>
    [profile_corpname1] =>
    [profile_corpid1] =>
    [profile_gender1] =>
    [profile_race1] =>
    [profile_bloodline1] =>
    [profile_balance1] =>
    [profile_charname2] =>
    [profile_charid2] =>
    [profile_corpname2] =>
    [profile_corpid2] =>
    [profile_gender2] =>
    [profile_race2] =>
    [profile_bloodline2] =>
    [profile_balance2] =>
    [profile_charname3] =>
    [profile_charid3] =>
    [profile_corpname3] =>
    [profile_corpid3] =>
    [profile_gender3] =>
    [profile_race3] =>
    [profile_bloodline3] =>
    [profile_balance3] =>
)

Output of user_save() (values with XXX are correct but hidden for confidentiality)
#

stdClass Object
(
    [uid] => 1
    [name] => xxx
    [pass] => xxx
    [mail] => xxx
    [mode] => 0
    [sort] => 0
    [threshold] => 0
    [theme] =>
    [signature] =>
    [created] => 1212881907
    [access] => 1213438867
    [login] => 1213032137
    [status] => 1
    [timezone] =>
    [language] =>
    [picture] =>
    [init] => xxx
    [data] => xxx
    [timezone_name] =>
    [form_build_id] => form-77bc32e7ca371f0ca0739eaebdd40b8c
    [profile_api_status] => Error
    [roles] => Array
        (
            [2] => authenticated user
        )

    [profile_uid] => xxx
    [profile_api] => xxx
    [profile_charname1] => xxx
    [profile_charid1] => xxx
    [profile_corpname1] => xxx
    [profile_corpid1] => xxx
    [profile_gender1] => xxx
    [profile_race1] => xxx
    [profile_bloodline1] => xxx
    [profile_balance1] => xxx
    [profile_base-attributes1] => xxx
    [profile_attributes-enhancers1] => xxx
    [profile_total-attributes1] => xxx
    [profile_skills1] => xxx
)

You can see that only profile fields with "1" terminaison are filled, whereas my $fields table contain the 1, 2, and 3...

See the attached screenshot to see that my profile fields are correctly set up in administration.

It's a very strange bug and I have absolutely no ideas of what can cause this strange behavior, I really need help.

Thank you

zmove

#1

zmove - June 14, 2008 - 10:36

Problem with attached picture upload, this is not the first time....

AttachmentSize
screen1.png 11.87 KB

#2

zmove - June 14, 2008 - 10:48

After some bug tracking, I point out what could be the cause of the problem.

The fact to save empty field seems to be the cause of the issue. If, for my fields, I save the string 'error' instead of an empty string, it works.

So do I use the wrong way to save empty fields for user (maybe there is another dedicated function), or it is a bug in the behavior of user_save ?

#3

Gábor Hojtsy - January 7, 2009 - 10:54
Version:6.2» 6.x-dev
Category:bug report» support request
Priority:critical» normal

This is a development support request. Recategorizing.

#4

ainigma32 - January 24, 2009 - 16:02
Status:active» postponed (maintainer needs more info)

@zmove: looking at the age if this issue I hope you figured this out already. Can you confirm?

- Arie

#5

ainigma32 - February 6, 2009 - 21:53
Status:postponed (maintainer needs more info)» fixed

Looks like zmove won't be posting any feedback so I'm setting this to fixed.

Feel free to reopen if you think that is wrong.

- Arie

#6

System Message - February 20, 2009 - 22:00
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.