VBO operation type plugins can add their own settings to the VBO Views field handler's admin form with adminOptionsForm().

However, within adminOptionsForm() there is no access to the current view.

That means that you can't do anything such as select from the fields on the view, because there's no way to get interrogate the current view.

This is easily fixed by adding a parameter to adminOptionsForm(), which is called from views_bulk_operations_handler_field_operations::options_form(), which DOES have access to the view.

It seems to me that the most sensible thing would be to actually pass the handler, just in case there are properties on the handler itself that might be useful (you never know). The view can easily be obtained from $handler->view.

Comments

joachim’s picture

Status: Active » Needs review
StatusFileSize
new2.16 KB

Here's the patch.

joachim’s picture

Category: feature » bug

Actually, there's a very good reason for needing the $handler passed in.

Without it, the plugin's adminOptionsForm() can't get to the values the user has previously set for the options in its form, and hence can't fill in default form values. (Unless I'm missing some magic somewhere!) On the basis of that, changing this to a bug.

joachim’s picture

This is necessary if we restore VBO as a dependency of Views Send -- see https://drupal.org/node/1477828#comment-7784777.

bojanz’s picture

Issue summary: View changes
Status: Needs review » Fixed

Committed, thanks.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.