PHP warning: Missing argument

Kevin,

I have many warnings in my logs:

[14-Jun-2011 09:46:58] PHP WARNING: 2011-06-14 09:46:58 (CEST): "Missing argument 1 for flexgroupprofile_get_profile_form(), called in /mnt/data_raid/www/mod/form/views

/default/form/search_results_simple.php on line 31 and defined" in file /mnt/data_raid/www/mod/flexgroupprofile/models/model.php (line 19) 

 

So I looked at the code and found this function:

function flexgroupprofile_get_profile_form($entity,$group_profile_category='') {

   return form_get_latest_public_profile_form(2,$group_profile_category);

}

 

Shouldn't this be:

 

function flexgroupprofile_get_profile_form($entity=2,$group_profile_category='') {

   return form_get_latest_public_profile_form($entity ,$group_profile_category);

}

  • Hi Ruben,

    Not quite. The idea was to define a function for group profiles that was flexible enough to handle a different profile for every group. But it is not implemented yet and so the first argument is thrown away. The second argument is used though, so you can define a different profile for every group category.

    The first argument to form_get_latest_public_profile_form is not the group but rather a constant specifying that this a group profile. I have actually defined those elsewhere so I think this should be the proper code:

    function flexgroupprofile_get_profile_form($entity='',$group_profile_category='') {
        return form_get_latest_public_profile_form(FORM_GROUP_PROFILE,$group_profile_category);
    }

    I have modified my own copy accordingly. Thanks for the bug report!

  • Excellent, warnings gone, tx!

Form and related plugins

Form and related plugins

User-generated content, flexible user and group profiles, registration forms, custom file forms