Latest dev of VBO
Drupal 7.13
VBO 7.x-3.0-rc1+20-dev (2012-Jun-03) Tried RC1 Also
Rules 7.x-2.1

New Components are no longer added as possible operations choices in VBO content view columns. Older ones are still there and i can edit them and see the changes so the list is updated but for some reason the last 5 or 6 components I've added don't show up.

CommentFileSizeAuthor
#11 vbo-rule.jpg36.37 KBmicnap

Comments

bojanz’s picture

Priority: Critical » Normal
Status: Active » Postponed (maintainer needs more info)

Retest with tomorrow's -dev.
Retry with the admin user.

Let me know if that fixed it.

acrazyanimal’s picture

I think an issue I am seeing might be related. After updating to the last release of VBO/Rules I no longer can add VBO fields to my views or edit existing ones if I've added new components. I get an ajax error.

I am using views-7.x-3.5 and I updated to the latest dev as you suggested above and it didn't fix this issue I'm seeing.

The following ajax error happens when I try creating a new view based on the relation entity and I try adding a VBO field. Throbber spins for minute and then the AJAX error pops up.

An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows.
Path: http://sitename.org/admin/structure/views/ajax/add-item/transactions_relations/default/field
StatusText: OK
ResponseText: Notice: Undefined index:  action::views_bulk_operations_delete_item in options_form() (line 114 of /home/drupal7/sites/all/modules/contrib/views_bulk_operations/views/views_bulk_operations_handler_field_operations.inc)

On an existing view with a VBO field if I click to modify it I get the following ajax error:

An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows.
Path: /admin/structure/views/ajax/config-item/entity_administration_memberships/default/field/views_bulk_operations
StatusText: OK
ResponseText: Notice: Undefined index:  rules_component::rules_test_membership_rule in options_form() (line 114 of /home/drupal7/sites/all/modules/contrib/views_bulk_operations/views/views_bulk_operations_handler_field_operations.inc)

where rules_test_membership_rule is the new rule I just added. I tested this on a different entity just to make sure its not just relation entities this is happening on.

acrazyanimal’s picture

Its probably also worth mentioning that VBO fields can still be modified for views based on entities that do not have related new rules components since the field was last modified. As soon as you add a new rules component that uses that entity type as an input parameter I get the ajax error if I try to modify any VBO field for views based on that entity type.

Sinovchi’s picture

I confirm the similar error

acrazyanimal’s picture

Status: Postponed (maintainer needs more info) » Active
raquelcesar’s picture

I'm using VBO 7.x-3.0 and I was also getting the first error described in #2. After some debugging I found the reason for that error was that the $options array was empty on execution of line 114 on the file views_bulk_operations_handler_field_operations.inc:

$operation_options = $options[$operation_id];

The above code is executed in the following cycle:

foreach (views_bulk_operations_get_applicable_operations($entity_type, $options) as $operation_id => $operation)

and the function views_bulk_operations_get_applicable_operations is modifying locally the $options array. So, the solution I found was to pass this array by reference to the function. I replaced the function definition:

function views_bulk_operations_get_applicable_operations($entity_type, $options)

with

function views_bulk_operations_get_applicable_operations($entity_type, &$options)

and the problem was solved for me.

micnap’s picture

Thank you raquelcesar. I had the same issues and this solved it for me also.

Mickey

micnap’s picture

I spoke too soon. Passing $options by reference got rid of the error but I'm still not seeing new rules components for selection when adding a vbo field to a view.

Mickey

raquelcesar’s picture

The error I got happened when I created a new view for a custom entity. I'm new to Drupal and that was my first attempt at creating a view.

Intrigued by your comment, I just created a new rule component and tried creating a view with a VBO field that could expose it. I had no problems with that and could see the new rule component for selection just fine. I tried with different rule components, even with one that could be applied to any entity, always without problems. So, I'm afraid I can't be of much help.

Maybe your issue has to do with the views version you have? I'm using Views 7.x-3.5 and VBO 7.x-3.0.

bojanz’s picture

The notice from #2 / #6 is handled in #1738226: Notice: Undefined index: action::node_assign_owner_action in options_form().

So far I've been unable to reproduce any rules components not showing (even though there is a similar complaint every few months), I think it has only been PEBCAK so far.
You will need to provide more information for me to try and reproduce it (export of the view, export of the rules component).

micnap’s picture

StatusFileSize
new36.37 KB

Here's my view:

$view = new view();
$view->name = 'test';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'redhen_membership';
$view->human_name = 'test';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */

/* Display: Master */
$handler = $view->new_display('default', 'Master', 'default');
$handler->display->display_options['title'] = 'test';
$handler->display->display_options['use_more_always'] = FALSE;
$handler->display->display_options['access']['type'] = 'none';
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['pager']['type'] = 'full';
$handler->display->display_options['pager']['options']['items_per_page'] = '10';
$handler->display->display_options['style_plugin'] = 'default';
$handler->display->display_options['row_plugin'] = 'fields';
/* Field: Bulk operations: Membership */
$handler->display->display_options['fields']['views_bulk_operations']['id'] = 'views_bulk_operations';
$handler->display->display_options['fields']['views_bulk_operations']['table'] = 'redhen_membership';
$handler->display->display_options['fields']['views_bulk_operations']['field'] = 'views_bulk_operations';
/* Field: Membership: Membership ID */
$handler->display->display_options['fields']['membership_id']['id'] = 'membership_id';
$handler->display->display_options['fields']['membership_id']['table'] = 'redhen_membership';
$handler->display->display_options['fields']['membership_id']['field'] = 'membership_id';
/* Field: Membership: Flags */
$handler->display->display_options['fields']['field_flags']['id'] = 'field_flags';
$handler->display->display_options['fields']['field_flags']['table'] = 'field_data_field_flags';
$handler->display->display_options['fields']['field_flags']['field'] = 'field_flags';
$handler->display->display_options['fields']['field_flags']['type'] = 'taxonomy_term_reference_plain';
$handler->display->display_options['fields']['field_flags']['delta_offset'] = '0';
/* Filter criterion: Membership: Type */
$handler->display->display_options['filters']['type']['id'] = 'type';
$handler->display->display_options['filters']['type']['table'] = 'redhen_membership';
$handler->display->display_options['filters']['type']['field'] = 'type';
$handler->display->display_options['filters']['type']['operator'] = 'not in';
$handler->display->display_options['filters']['type']['value'] = array(
'contract' => 'contract',
);

/* Display: Page */
$handler = $view->new_display('page', 'Page', 'page');
$handler->display->display_options['defaults']['hide_admin_links'] = FALSE;
$handler->display->display_options['path'] = 'test';

And my component:

{ "rules_remove_flag_print_certificate" : {
"LABEL" : "Remove flag - print certificate",
"PLUGIN" : "rule",
"REQUIRES" : [ "rules" ],
"USES VARIABLES" : { "certification" : { "label" : "certification", "type" : "redhen_membership" } },
"IF" : [
{ "entity_has_field" : { "entity" : [ "certification" ], "field" : "field_flags" } }
],
"DO" : [
{ "list_remove" : { "list" : [ "certification:field-flags" ], "item" : "130" } }
]
}
}

And the strange thing is....I can see the component in the $form array, just not in the Select bulk operations list. See attached image.

I've tried dumping Drupal cache, views cache, and browser cache. I can only figure it's a permissions issue that it's not showing up. But I don't have any permissions set on the component and I'm logged in with user #1. Any help would be greatly appreciated!

I'm using Views 7.x-3.5+24-dev, VBO 7.x-3.0+10-dev, and Rules 7.x-2.2+5-dev.

Thanks,
Mickey

micnap’s picture

O...M....G. Just shoot me. I discovered that the rule was even displayed in the HTML of the page. It was being HIDDEN by the Rubik admin theme. Grrrrrrrrr!!!

views-admin.rubik.css has this:

[class*="form-type-checkbox"][class*="remove"] {
display: none;
}

So, if you're using the Rubik theme for your admin theme....don't use the word 'remove' in the machine name of your rules components!!!!!!

Hours of VBO, views, and rules troubleshooting down the drain.

Hope this helps someone in the future.

Mickey

bojanz’s picture

Status: Active » Closed (works as designed)

Okay, that is super stupid :)
I will add a note to the documentation pages or the README, and keep that in mind for future support requests.