Options in the User account are confusing when using a automatically accepted relation type
| 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 |
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
#2
#3
Not sure why this was marked fixed
#4
Hi,
alex.k Can you please explain in details what the actual issue is, I am little bit confused
#5
@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
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
Fixed, committed in http://drupal.org/cvs?commit=230910.
#8
Automatically closed -- issue fixed for 2 weeks with no activity.
#9
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
);
}
}
?>
#10
#558800: "Relationship Settings" fieldset in MyAccount>Edit is broken is a duplicate of this.
#11
Committed in http://drupal.org/cvs?commit=279482 thanks Kars-T!
#12
Automatically closed -- issue fixed for 2 weeks with no activity.