Hello,

There is some issue when you go to the User account edit page, and there is only one relation that is automatically accepted, the field to select the automatic acceptation is still there in the account, but there is nothing to select.

I think it should either hide this field, or maybe show a greyed out box with the automatic relation. Cause now, you go to your user page and you see this text :

Automatically approve the following relationship requests:
Check off the types of relationships you'd like to automatically approve.

Problem is that under it, there is nothing to choose, so it's confusing.

I think solution is to say that if only one relation exists AND that relation is automatically accepted, then this should just not be shown to the user.

Unfortunately, I don't really know PHP, so can't really provide any patches.

I guess the larger idea here is that this module needs to handle One way automatic relations. But this means "real" one way, so the requestee should not have the right to remove the relation, etc. All my issues at this point are related to this type of relations not really handled...

Do you think you would implement support for this kind of relations eventually??

thanks,
Patchak

CommentFileSizeAuthor
#9 ur-453090-v1.patch2.27 KBkars-t

Comments

MisterSpeed’s picture

Assigned: Unassigned » MisterSpeed
bob jk’s picture

Status: Active » Fixed
alex.k’s picture

Status: Fixed » Active

Not sure why this was marked fixed

MisterSpeed’s picture

Hi,
alex.k Can you please explain in details what the actual issue is, I am little bit confused

alex.k’s picture

Status: Active » Postponed (maintainer needs more info)

@63reasons I think original poster means that when you have just one relationship type defined, and it is set to not require approval, user profile edit page shows an empty fieldset asking which relationship types should be automatically approved - because there are no types that require approval.

@patchak please provide us screenshots of user profile page showing the problem

patchak’s picture

hey guys, yes this is exactly the issue. To recreate, simply create a relation type where approval is not required (set to auto approve). If this is the only relation on the site, the in the user/%/edit page you will find the option to "select the relations to approve automatically".

Since the only relation on that site is set to auto approve, that section is empty. This is a problem since it's really confusing to see this if there is nothing you can do.

alex.k’s picture

Assigned: MisterSpeed » alex.k
Status: Postponed (maintainer needs more info) » Fixed

Status: Fixed » Closed (fixed)

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

kars-t’s picture

Status: Closed (fixed) » Needs review
StatusFileSize
new2.27 KB

We had a case where the fieldset was empty even with this patch. I believe it is much better to onyl build the fieldset if $options is not empty. This did solve our problems:

Before

$form['user_relationships_ui_settings'] = array(
  //Fieldset
);

if (variable_get('user_relationships_allow_auto_approve', FALSE) && ($relationships = user_relationships_types_load())) {

   //do stuff and get $options
   
  //#453090 hide if there are no options
  if (!count($options)) {
    //this indicates that there could be no field! 
    //So why check here and not outside the if or better never build the fieldset?
    unset($form['user_relationships_ui_settings']['user_relationships_ui_auto_approve']);
  }
}

Patched

 if (variable_get('user_relationships_allow_auto_approve', FALSE) && ($relationships = user_relationships_types_load())) {

  //do stuff and get options

  //#453090 Only build if there are options
  if (count($options)) {
    $form['user_relationships_ui_settings'] = array(
     //fieldset
    );

    $form['user_relationships_ui_settings']['user_relationships_ui_auto_approve'] = array(
      //$options checkboxes
    );
  }
}
alex.k’s picture

alex.k’s picture

Status: Needs review » Fixed

Committed in http://drupal.org/cvs?commit=279482 thanks Kars-T!

Status: Fixed » Closed (fixed)
Issue tags: -rc3block

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