Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The following patch adds a configurable delimiter to the action "Pass ids as arguments to a page (views_bulk_operations_argument_selector_action)".
For security I have limited the options to a select list of a comma (,) and plus (+) for use with the views contextual filters (AND / OR respectively). I chose to make it a select list for security, but it could easily be extended with more delimiters or a text field for any value.
Please review, thanks.
Comment | File | Size | Author |
---|---|---|---|
#2 | views_bulk_operations-add_delimiter_option-1802450-3.patch | 1.68 KB | sethfisher |
#1 | views_bulk_operations-add_delimiter_option-1802450-2.patch | 1.7 KB | elBradford |
Comments
Comment #1
elBradford CreditAttribution: elBradford commentedAttached patch.
Comment #2
sethfisher CreditAttribution: sethfisher commentedHere's a very similar approach I implemented (without having seen this post). It uses a text field allowing for any character to be used as a separator, and it uses the term separator rather than delimiter. The default is a comma.
Comment #3
kenorb CreditAttribution: kenorb commentedI can't test the patch, as when I'm exporting, I'm redirected to the following URL:
/my_view/export/11219%2C11222
This happens with and without patch, it seems that something is not encoded correctly.
Any clues?
Comment #4
gkaas CreditAttribution: gkaas commented@kenorb you might have to change the contextual filters of your export view and validate the ids seperated by , or +. This probably fixes your encoding issue...
Comment #5
pebosi CreditAttribution: pebosi commentedPatch is still working fine and applies nicely.
Comment #6
pebosi CreditAttribution: pebosi commentedComment #7
Chris Matthews CreditAttribution: Chris Matthews commented