Options in the User account are confusing when using a automatically accepted relation type

patchak - May 4, 2009 - 12:18
Project:User Relationships
Version:6.x-1.x-dev
Component:User interface
Category:bug report
Priority:normal
Assigned:alex.k
Status:closed
Issue tags:rc3block
Description

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

#1

63reasons - May 6, 2009 - 08:52
Assigned to:Anonymous» 63reasons

#2

bob jk - May 7, 2009 - 05:30
Status:active» fixed

#3

alex.k - May 7, 2009 - 09:05
Status:fixed» active

Not sure why this was marked fixed

#4

63reasons - May 7, 2009 - 10:00

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

#5

alex.k - May 7, 2009 - 10:04
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

#6

patchak - May 8, 2009 - 18:23

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.

#7

alex.k - June 28, 2009 - 17:44
Assigned to:63reasons» alex.k
Status:postponed (maintainer needs more info)» fixed

Fixed, committed in http://drupal.org/cvs?commit=230910.

#8

System Message - July 12, 2009 - 17:50
Status:fixed» closed

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

#9

Kars-T - September 28, 2009 - 12:50
Status:closed» needs review

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

<?php

$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

<?php

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
   
);
  }
}
?>

AttachmentSize
ur-453090-v1.patch 2.27 KB

#10

alex.k - October 24, 2009 - 18:54

#11

alex.k - October 24, 2009 - 19:39
Status:needs review» fixed

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

#12

System Message - November 7, 2009 - 19:40
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.