Add role options from user_user_operations

Michelle - October 17, 2008 - 03:18
Project:Views Bulk Operations (VBO)
Version:6.x-1.x-dev
Component:Core
Category:feature request
Priority:normal
Assigned:kratib
Status:closed
Description

I'd really like this module to selectively promote users to a role based on a view of users that don't already have that role. Unfortunately, it doesn't give the role option from user_user_operations in the UI. The other ones are there but not the role ones. Is there a reason for this? Can they be added?

Thanks,

Michelle

#1

kratib - October 17, 2008 - 17:59

If you are referring to the filter that's shown on admin/user/user, then note that this page is hardcoded, instead of being based on a view. Therefore this filter you're seeing is not associated with the user_user_operations. In fact, hook_user_operations() does not specify a UI for its functions.

If you want to emulate the users page, you can simply create a users view with Bulk Operations style, add to it a filter similar to the one you want, and pick up the user_operations from the actions list. That should do it!

#2

Michelle - October 17, 2008 - 17:59

I'm afraid you completely misunderstood my request. I am making a bulk operations style view. The problem is that the actions I need aren't in the list even though they are in user_user_operations(). Moonshine, on IRC, did some digging and found out why. Only the actions that have a callback are included in VBO. I'm not familiar with the VBO code so I don't know how difficult it would be to add the other ones but at least he's identified the problem. It's up to you where you want to take it from there. I think it would be worth adding these if it's possible as I'm sure I'm not the only one that would expect role promotion/demotion and user deleting (the other missing action) to be available to VBO.

Thanks,

Michelle

#3

kratib - October 17, 2008 - 18:26

Thanks for clarifying. VBO has no way of inferring what to do when it finds no callback on an operation, thus it drops it. I'll work on adding alternate versions of these operations. Or you can contribute them if you wish, just package them as actions of type 'user'.

#4

Michelle - October 17, 2008 - 18:33

Yeah, once Moonshine pointed out the lack of callbacks it was clear that was the problem. Ok, looks like this will be a matter of who has time first. :) The site I need this on is lowish priority for me and I don't know where to even begin writing a new operation for VBO. So it might be a bit before I can dedicate the time to it. At least the issue is here so anyone else that has tihs problem knows what's going on and hopefully one of us can get the actions added in soon.

Thanks,

Michelle

#5

kratib - December 5, 2008 - 05:11
Status:active» postponed

Nothing happened here for a while: I'm postponing the issue until someone gets time to work on the needed operation.

#6

Michelle - December 5, 2008 - 14:38
Assigned to:Anonymous» Michelle

Yeah, sorry, I have had no time for that site. I'm behind in updating it even. I'll reopen this if I get back to it.

Going to assign it to myself to make it easier to find again.

Michelle

#7

aharown07 - April 8, 2009 - 14:40

I'd also like to see role assignment, etc. as bulk op choices. Hope someone can find time to put it together.

#8

Michelle - April 8, 2009 - 15:02
Assigned to:Michelle» Anonymous

Oh, might as well unassign this. I don't see me having time for this until this summer at the earliest.

Michelle

#9

DanielJohnston - April 16, 2009 - 00:52

Subscribing. I've been after this for some time, only just found this request.

#10

kratib - April 16, 2009 - 03:09
Assigned to:Anonymous» kratib
Status:postponed» fixed

Fixed in the latest dev. The new user action is called "Modify user roles". Please try it and let me know.

#11

Michelle - April 16, 2009 - 21:31

Cool, thanks. I'm not actively working on that site right now but will try to remember to try this out soon. :)

Michelle

#12

aharown07 - April 17, 2009 - 03:32

Works in my tests with no errors... both adds and removes.
Love this module, by the way!

#13

System Message - May 1, 2009 - 03:40
Status:fixed» closed

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

#14

askibinski - November 4, 2009 - 13:30
Component:Code» Core

Nice to see this feature, works great.

Just to let you know: it would be even better if this action would be available if you are showing user-data through a relationship in views (which currently it isn't).

example:
In my case I added an additional display (menu tab) in the default view called 'users' and used a content_profile relationship to show data in the rows from the account as well the linked content profile (node). However, I'm guessing because of the main default view being a node view, the modify user roles action is not available.

It's not really an issue / feature request because you can easily add a separate 'user' view and get it in that way, but it would be nice if everything could be managed from one view and the user menu tab could be a display in this view.

 
 

Drupal is a registered trademark of Dries Buytaert.