when using a VBO view with more than one argument in a rules component the arguments are specified in a text area, one argument per line.

however this breaks if the new line delimiter is \n or \n\r since _views_bulk_operations_rules_get_field() uses explode("\r", $args)

I'm not sure if newline delimiter varies by server OS or browser, attached patch works for me by exploding on the PHP_EOL constant then trimming result. but it might be a better idea to preg_split on all possibilities (I think that's how core deals with similar textareas like the block visibility one).

CommentFileSizeAuthor
#1 1265374.patch727 bytesbojanz
vbo_rules_views_arguments_fix.patch519 bytesalaa

Comments

bojanz’s picture

Status: Active » Needs review
StatusFileSize
new727 bytes

Good catch.
I have no idea why I went with \r, it makes absolutely no sense.
PHP_EOL is wrong because it points to the server newline, and in this case it's the client who enters different newlines.
Try this patch. It uses the approach taken from the Field module (the "Allowed values" textbox).

alaa’s picture

works fine, are we sure there will never be a views argument that starts or ends with white space?

bojanz’s picture

Title: rules support broken for views with multiple arguments » Passing multiple arguments to Views from the Rules action is broken.
Status: Needs review » Fixed

I'm prepared to take that risk.
Committed: http://drupalcode.org/project/views_bulk_operations.git/commit/da61a23

Thank you for contributing to VBO!

Status: Fixed » Closed (fixed)

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