When group administrator attempts to delete the group owner from the group the status message states:"Performed Remove from group on 1 item" and all is green.
Unexpectedly the group owner is not deleted. Internally there is a check that disables the removal of group owner, which is OK, but no message is generated to the user to explain the difference in behavior.

Suggested fix:
Add an error message with appropriate text.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ndobromirov’s picture

Upload of an initial solution patch. Any comments or ideas are welcome.

There is on more idea but I was not able to find a proper place to implement the change because of free time issues :).
If it is possible to disable the checkbox for group owner, when delete action is chosen, thus preventing the user from doing the action in the first place.

ndobromirov’s picture

Status: Active » Needs review

Forget to change the status!

amitaibu’s picture

Status: Needs review » Needs work
+++ b/includes/actions/membership_delete.action.incundefined
@@ -20,6 +20,7 @@ function og_membership_delete_action($og_membership, $context) {
+    drupal_set_message(t('Removal of group owner is forbidden!'), 'error');

The API shouldn't deal with messages. This is something that should live in OG-UI as a validate handler.

ndobromirov’s picture

Hello again and sorry for the late response :]

Well, it sounds good to add this as a validate handler in the UI, but this will be a duplication of the busyness rule that defined the check in the first place here in the API.

Isn't it a better idea to add a hook that will notify the UI module and any other in that matter for the event 'attempted_group_admin_delete'?

With this, groups UI will just need to implement a simple one-line hook with the set message in it. I will post a patch if this solution is accepted.

BR,
Nikolay Dobromirov.

ndobromirov’s picture

Did somebody looked at this for the last 2 months :) ?