Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I am trying to get used to the new views edit page, but it seems that when I add a User-VBO field that the settings have a block user option, but no option for unblocking users.
Comments
Comment #1
createnouui CreditAttribution: createnouui commentedSubscribing
Comment #2
bojanz CreditAttribution: bojanz commentedThis is a drupal core omission. Core includes only the block action, for some stupid reason.
I've posted a patch at #512042: Add user action "unblock current user" to user.module, so you can try it out, and we can try to get it into Drupal 7, fast ;)
In the meantime, you can just create a rules component that changes the "status" of user to 1.
Comment #4
liquidcms CreditAttribution: liquidcms commentednot sure this should be marked as "fixed" since the patch never made it into D7 core and there is no action added to VBO
maybe this is closed (won't fix)?
Comment #5
bojanz CreditAttribution: bojanz commentedI was too much of an optimist. Let's get this into VBO.
Comment #6
liquidcms CreditAttribution: liquidcms commentedi did take your advice and did up the action with Rules; only took a couple minutes; but the Rules UI is certainly not for the faint of heart - a coded action would certainly be better. i'll do up a patch this weekend if you haven't already beat me to it.
Comment #7
aharown07 CreditAttribution: aharown07 commentedDid this ever happen?
As a user admin tool, VBO is great... much greater if there are clear and simple basic user actions.
Comment #8
mark_fullmerHere's how I created an "unblock users" VBO button with Rules Link:
1) Create a Rules Link of type "user"
2) Configure a Rule within this Rules Link (this is odd workflow logic, but whatever) with the Element "Unblock a User" (you don't have to create a loop here or anything, just the action)
3) Go to your View. There should now be a new field option called "Bulk Operations: User" that is your Rules Link. Add it to the view display.
Comment #9
heyyo CreditAttribution: heyyo commented#8 I didn't know this module Rules link, nice one.
But by using your method, I need to give the permissions "Administer users" to the user which could unblock user.
Otherway the option of "unblock user" is not displayed.
Any idea how to not give this permission ?
EDIT: But the action "block user" works as expected even without "Administer users" permission. Why it's defined like this ?
Comment #10
diegocasmo CreditAttribution: diegocasmo commentedI solved this by doing the following:
http://anthonypower.com/notebook/how-add-unblock-selected-users-option-v...
Comment #11
alberto56 CreditAttribution: alberto56 commentedI needed this functionality fast and the patch at #2 of #512042: Add user action "unblock current user" to user.module works fine with the latest version of D7.
Comment #12
WorldFallz CreditAttribution: WorldFallz commentedAs web pages come and go, here's the rule's component from the anthonypower.com post linked in #10:
I can confirm it works perfectly. It's way overkill to install rules just for this, but if you use it already it's a no-brainer.
Simply navigate to admin/config/workflow/rules/components/import, paste the code above, and click import. And don't forget to go back and edit the view to check that option in the VBO field. That's it!
Kudos to diegocasmo for finding and posting that link and to the original author for his blog post.
Comment #13
sumit.prajapati CreditAttribution: sumit.prajapati commentedAdd Unblock user option by rules in views bulk operation
Comment #14
MatthijsG CreditAttribution: MatthijsG as a volunteer commentedThanks Sumit Prajapati!
I was looking for this, you provided a good tutorial.
One little thing: in step
Select Data Selector -> unblock-user and Save
Is 'unblock-user' default by Drupal or the given name earlier? It should be mentionend then, that you've to select the value with the name you gave earlier.
===
And an additional question: the unblock-option is now in the dropdown-menu.
How to make a link in the table to unblock?
Comment #15
sumit.prajapati CreditAttribution: sumit.prajapati commentedThanks for reply MatthijsG
first is- Given name earlier unblock-user
second is- You have to create custom field handler
take some help from given link- http://www.codesidekick.com/blog/database-independent-views-3-custom-field-handlers
Comment #16
petednz CreditAttribution: petednz commented@WorldFallz - thanks for taking the trouble to paste the Rule to import - made this super quick to add.
Comment #17
shaneod CreditAttribution: shaneod commentedThanks Sumit Prajapati - very useful tutorial!