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.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 2072057.relative.views_bulk_operations.pass-handler-to-operation-plugin.patch | 2.16 KB | joachim |
Comments
Comment #1
joachim commentedHere's the patch.
Comment #2
joachim commentedActually, 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.
Comment #3
joachim commentedThis is necessary if we restore VBO as a dependency of Views Send -- see https://drupal.org/node/1477828#comment-7784777.
Comment #4
bojanz commentedCommitted, thanks.