I'm basically trying to make changes to a field on ALL user accounts on a certain action. I've got a boolean value in user account details that I want to turn to 'off' when the administrator adds a certain type of content. (This will be for super important notes that need acknowledging, so while the user can change the value to verify they've seen said notes, whenever a new one is added everyone's needs to go back to 0 instead of 1.)  

In D7 I accomplished this sort of thing with VBO and Rules modules, which allowed for a rules action 'Load a list of entity objects from a VBO View.' to work from.  I haven't really worked with it much yet, but 'bulk operations' seems to be part of core along with views now (which is great - but doesn't give me that option in rules any longer.)

Is there a way to access this functionality again in Backdrop with rules or any thoughts on an alternative method?  

- Content type of 'Super Important Note' added.
- All user accounts (regardless of roles) have the boolean field 'HasViewed' set to 0.

Screenshot of a D7 rule that did this (albeit when cron was run instead of when content was added, but the event isn't an issue to change.)

Most helpful answers

I don't believe this rules action is implemented in Backdrop. In D7, this action was defined as part of the module views_bulk_operations. Now that bulk operations is part of the module views, that rule action needs to be created in a separate custom module.

It shouldn't be too difficult to create a custom module that implements hook_rules_action_info() and pretty much copy the necessary code found in D7's views_bulk_operations.rules.inc. You would need to copy the definition of views_bulk_operations_action_load_list within the function views_bulk_operations_rules_action_info(), and the following callbacks and helper functions: 

  • views_bulk_operations_views_list()
  • views_bulk_operations_action_load_list()
  • _views_bulk_operations_rules_get_field() -- this is the one that actually gets the view
  • _views_bulk_operations_rules_get_entity_type() 
  • views_bulk_operations_action_load_list_info_alter() 
  • _views_bulk_operations_rules_get_entity_type()
  • (I may be missing some...)

 

Good luck!

Comments

I don't believe this rules action is implemented in Backdrop. In D7, this action was defined as part of the module views_bulk_operations. Now that bulk operations is part of the module views, that rule action needs to be created in a separate custom module.

It shouldn't be too difficult to create a custom module that implements hook_rules_action_info() and pretty much copy the necessary code found in D7's views_bulk_operations.rules.inc. You would need to copy the definition of views_bulk_operations_action_load_list within the function views_bulk_operations_rules_action_info(), and the following callbacks and helper functions: 

  • views_bulk_operations_views_list()
  • views_bulk_operations_action_load_list()
  • _views_bulk_operations_rules_get_field() -- this is the one that actually gets the view
  • _views_bulk_operations_rules_get_entity_type() 
  • views_bulk_operations_action_load_list_info_alter() 
  • _views_bulk_operations_rules_get_entity_type()
  • (I may be missing some...)

 

Good luck!

Thanks! that'll help - wasn't sure a good module route and if I could carve that out of VBO since it's bulk operations are in views now.  For now I'll go the PHP route,  but I will keep this bookmarked for later so I don't have to feel bad for using it when I have more time to sort out this and another module.

Hey stpaul,

Just replying because I'm 99% sure this got posted to the wrong thread ;)  But thanks for previous help and for being helpful to whoever is trying to do something with ads?   (Couldn't find the thread.)

I was just trying to figure out what happened with my message. Yes, wrong topic. :-)