I created a simple Rules component that displays a message with the id of the file attached to a node (later I'd like to save this file). I selected the component in the VBO field, OK. But I open view page the option doesn't appear in the list of action available, it looks like a bug doesn't it?

Here's my rules component export:

{ "rules_convert_images_to_media_files" : {
    "LABEL" : "Convert Image content type to media files",
    "PLUGIN" : "rule",
    "REQUIRES" : [ "rules" ],
    "USES VARIABLES" : { "node" : { "label" : "Node", "type" : "node" } },
    "IF" : [
      { "node_is_of_type" : { "node" : [ "node" ], "type" : { "value" : { "photo" : "photo" } } } }
    ],
    "DO" : [
      { "entity_fetch" : {
          "USING" : { "type" : "file", "id" : [ "node:field-photo:file:fid" ] },
          "PROVIDE" : { "entity_fetched" : { "file" : "File" } }
        }
      },
      { "drupal_message" : { "message" : "Saving file [file:fid] of image [node:nid]" } }
    ]
  }
}

and here is my views vbo field export (I guess this is useless):

$handler->display->display_options['fields']['views_bulk_operations']['id'] = 'views_bulk_operations';
$handler->display->display_options['fields']['views_bulk_operations']['table'] = 'node';
$handler->display->display_options['fields']['views_bulk_operations']['field'] = 'views_bulk_operations';
$handler->display->display_options['fields']['views_bulk_operations']['vbo_settings']['display_type'] = '0';
$handler->display->display_options['fields']['views_bulk_operations']['vbo_settings']['enable_select_all_pages'] = 1;
$handler->display->display_options['fields']['views_bulk_operations']['vbo_settings']['force_single'] = 0;
$handler->display->display_options['fields']['views_bulk_operations']['vbo_settings']['display_result'] = 1;
$handler->display->display_options['fields']['views_bulk_operations']['vbo_settings']['entity_load_capacity'] = '10';
$handler->display->display_options['fields']['views_bulk_operations']['vbo_operations'] = array(
...
  'rules_component::rules_convert_images_to_media_files' => array(
    'selected' => 1,
    'use_queue' => 0,
    'skip_confirmation' => 0,
    'override_label' => 0,
    'label' => '',
  ),
...
);

Can anyone help me getting through that?

Comments

hosef’s picture

I appear to be having the same issue. I create a new rule/rule set and it shows up as an option when I am configuring the VBO field, but when I go to the actual view there are no options in the drop down box.

hosef’s picture

Title: Rules component displaying an attached file id isn't listed in VBO views options combobox » Rules components are not listed in the VBO options combobox on a view.

Changed the title to be more appropriate to the bug in question.

hosef’s picture

Status: Active » Closed (works as designed)

Ok, after a little digging it appears that this is not a problem with VBO. The issue is caused by the fact that Rules does not allow anyone, including uid 1, to execute a component by default.

There is already an issue in the Rules issue queue which should help to address the problem, #1647252: Access issue: "Administer rule configurations" permission doesn't grant components execution

Striky2’s picture

+1

Clearly a permission-type issue.

The ticket seem to say there is a workaround. Did anyone successfully use the suggested workaround to have the component action appearing on the top of the VBO view without being uid 1?

kristofferwiklund’s picture

If you edit you component. And under the Settings section. You have the checkbox
"Configure access for using this component with a permission."
Click that and then set allow permission for your administrator role. After that it works

vlyalko’s picture

This worked great. Thank you.

firfin’s picture

Actually this seems to be a duplicate of #1831578: Use file_entity_access() callback when file_entity module is present.
At the least the patch in there (committed to more recent versions of entity module) fixed it for me.

firfin’s picture

Status: Closed (works as designed) » Closed (duplicate)
firfin’s picture

Issue summary: View changes

Copy/paste correction

BrightBold’s picture

I tried the patch in #9 in #1831578: Use file_entity_access() callback when file_entity module is present but it turned out I was already using a version of Entity with that code included and I was still having this problem.

I didn't think it was a permissions issue since I was logged in as user1, but the solution in #5 here fixed it for me. Thanks.

johnlaine’s picture

Yes, #5 worked for me as well. A big thank you to you sir!

jweirather’s picture

#5. All day long.