Instead of loading a node list with loading the complete node object, in some cases it would be better to only load the node IDs.

I'll post a patch for that in a moment ;)

Comments

derhasi’s picture

Status: Active » Needs review
StatusFileSize
new2.41 KB

A slightly modified new action, without the node_load().

Patch attached ;)

itangalo’s picture

Status: Needs review » Active

I'm not sure about this one.

It makes sense to have a light-weight alternative to loading a bunch of nodes, but since it is now possible to use VBO to load lists of entities I think it makes more sense to use VBO. (I actually want to remove the load-nodes-with-views action from RB, now that it exists elsewhere.)

I don't know how VBO returns the stuff to Rules. Hopefully it is already a light-weight list – and then this is a non-issue. If it is a list of fully loaded nodes, then this needs a bit of thinking.

derhasi’s picture

Title: Load a Node-ID list with Views » Load a Entity ID list with Views

Unfortunately VBO does an entity load: $entities = entity_load($vbo->get_entity_type(), $ids);.

But providing a similar action would sure be possible (as the entity id will always be an integer).

Should we move that issue to VBO or would you provide that action in RB?

itangalo’s picture

Hm, ok – then it makes sense to add this functionality to RB (and hopefully ship it to a stable module in the future).

It would certainly be great to have this for any entity type – just as you suggest.

derhasi’s picture

Status: Active » Needs review
StatusFileSize
new2.84 KB

Ok, there's a patch for RB (with vbo as dependency for the whole "get entity type and column part).
I'll provide one later for VBO and post it as separate issue to VBO.

derhasi’s picture

itangalo’s picture

Awesome!
I'm following the issue over at VBO, and if that one doesn't get accepted I think this should go into RB.

derhasi++

dawehner’s picture

Status: Needs review » Needs work
+++ b/rb_misc.rules.incundefined
@@ -694,6 +725,46 @@ function rb_misc_rb_misc_node_clone_reset_properties_alter(&$properties_to_reset
+  foreach ($vbo->view->result as $row_index => $result) {
+    $ids[] = $result->{$vbo->field_alias};

What about using $view->query->get_result_entities($result), this would allow to use this with search api automatically.

mitchell’s picture

Title: Load a Entity ID list with Views » How to: Load a Entity ID list with Views
Project: Rules Bonus Pack » Rules
Component: Rules Bonus: Miscellaneous » Documentation
Category: feature » task
Status: Needs work » Active
Issue tags: +lists and loops

Views Rules fixes this feature request. bojanz said he will deprecate VBO's load a views list rule, and Itangalo recommended VBO over rb_views/rb_views.

We still need to update the docs to reflect this feature. I don't care that it's a separate module, I think it should be the canonical tool for the job (comments?). What's left is for Rules to account for Rules UI Factory, which I suspected #1493612: Components: set properties within plugins did, but am not sure anymore; more reviews are required.