I'm having a problem trying to set up the MySite profiles on my site. I can select or deselect any of the built-in profile fields, with no problem. With any of the new fields that I've created with the profile.module, I can check the appropriate checkboxes, but when I click on "save settings" the boxes clear themselves, and the fields never appear on MySite. Attached is a screen shot immediately after I've checked all the boxes and clicked "save settings."

Running MySite 5.x-2.1 on Drupal 5.1, MySQL v.5.0 and PHP v.4.4.7

Comments

agentrickard’s picture

I see it. So the module-defined elements (Picture, History, Gallery2) work, but user-defined profile elements don't.

These are all publicly-viewable textfields from profile module. right?

Will test.

agentrickard’s picture

Are these all set to a Profile Category?

agentrickard’s picture

Quick findings.

I verified this error. It seems to be caused by the space in the Profile Category name. Changing "Personal Information" to "Personal" should resolve the error, but the code needs to be altered to fix this.

agentrickard’s picture

Status: Active » Needs review

Try changing line 201 of /mysite/plugins/types/profile.inc to:

      $form[urlencode($key)]= array(

That seems to work.

agentrickard’s picture

StatusFileSize
new394 bytes

Sorry, the line numbers may be off. Replace the whole function:

function mysite_type_profile_form_items($allowed, $data) {
    foreach ($data as $key => $value) {
      $options = array();
      $current = array();
      foreach ($value as $k => $v) {
        $options[$v['name']] = $v['title'];
        if (in_array($v['name'], $allowed)) {
          $current[$v['name']] = $v['name'];
        }      
      }
      $form[urlencode($key)]= array(
        '#type' => 'checkboxes',
        '#title' => $key,
        '#value' => $current,
        '#options' => $options,
        '#required' => FALSE,
      ); 
    }  
  return $form;  
}

Lines 188-207 in profile.inc

agentrickard’s picture

StatusFileSize
new853 bytes

First patch only caught the admin settings. This patch should also affect display.

To apply, place the patch in your plugins/types directory first.

kokoyote’s picture

The patch seems to correct the problem, thank you. Fast work!

agentrickard’s picture

Status: Needs review » Reviewed & tested by the community

Well, this was the least tested new feature, so I feel a little guilty. I think its a cool feature, but it has some quirks (like the blank field in your screenshot).

kokoyote’s picture

That's true - I knew what that corresponded to, and it seemed to work properly, so I didn't worry about it. It controls the appearance of a link to the Gallery2 user gallery. The gallery.module inserts those fields into the profiles automatically.

agentrickard’s picture

Sure, it might work properly, buyt if you activate it and then a user goes to configure their profile element, they will be presented with a blank checkbox option.

How do we solve that problem?

agentrickard’s picture

Status: Reviewed & tested by the community » Fixed

Patch committed to HEAD.

agentrickard’s picture

Status: Fixed » Closed (fixed)

Fixed in 5.x.2.3