I haven't looked into how hard this would be, so if this is a huge amount of work, forget it. ;) However, some operations are more destructive than others. It'd be great to have a single view with a lot of operations, and only have to go through a confirm form for a subset of them. Would you commit such a feature if it was working and wasn't too complicated? Thoughts on how easy this would be to implement? Thanks!

Comments

dww’s picture

Status: Active » Needs work
StatusFileSize
new4.67 KB

Looking briefly at the code, it seems pretty straight forward inside views_bulk_operations.module itself. Instead of testing $plugin->options['skip_confirmation'], we could be testing something like $plugin->options['skip_confirmation'][$operation].

The bigger question appears to be the UI for the views style plugin. Seems like we need a table instead of the current pile of checkboxes and operations. I'm trying to figure out how easy that is from merlinofchaos in IRC right now. ;) Not trivial. For an initial attempt, this just duplicates the operations with another set of checkboxes to control the confirm form. I know it's lame, but I'm just getting it started.

Another tricky part is the upgrade path, since existing views will have an integer saved for this option, instead of an array. This patch completely ignores this problem.

Otherwise, it works fine -- it's just ugly and doesn't handle existing views that think skip_operation is an int, not an array.

infojunkie’s picture

Thanks for the initiative. I haven't looked at the patch yet, but it seems that what you achieved is to specify the confirmation *per operation per view*, not just per operation. If you wanted to do the latter, you would expose a general VBO config screen in the Drupal admin section, in which you would ask which operations need confirmation. Which one makes more sense in your usage scenario?

dww’s picture

Oh interesting. I hadn't thought of doing a site-wide setting to globally specify confirmation for each operation. I suppose that any operation that's "destructive" and would often want a confirmation step would probably always want it. However, that would introduce a lot of site-wide variables, which are more expensive overall for the site than these per-view settings which are only loaded with the view when needed, instead of on every page no matter what. Also, I could dream up use-cases where you'd want confirmation on an operation in some cases but not others. For example, what about an "expert mode" admin view somewhere that assumes you know what you're doing, vs. the standard admin view that people get by default.

So, I think it'd probably make sense to just continue down the current path and see how nasty the theme function stuff to get the UI better is. If it's a huge can of worms, we can reconsider, but since the actual functionality now works in the more fine-grained approach, we might as well keep it. ;)

That said, I'll certainly defer to the community -- we should probably get some other VBO users/developers to weigh in here.

Thanks!
-Derek

infojunkie’s picture

Status: Needs work » Postponed
jjwhitney’s picture

StatusFileSize
new3.93 KB

I've updated this patch to work with the latest VBO source.

infojunkie’s picture

Status: Postponed » Fixed

Thanks for the updated patch.

I used this opportunity to make a major settings UI update. Please try it and let me know!

jjwhitney’s picture

I had a little trouble at first after updating, because my view wasn't showing any records, but clearing the cache did the trick.

It works great now! Thanks!

jjwhitney’s picture

Status: Fixed » Active

Hmmm... I still have one little problem: For single actions using "Merge single action's form with node selection view", the "Skip confirmation step" checkbox has no effect.

bojanz’s picture

Also, this needs to be ported into 7.x-3.x.

bojanz’s picture

Title: Specify confirmation per operation instead of per view? » Specify confirmation per operation instead of per view
Version: 6.x-1.x-dev » 7.x-3.x-dev
Status: Active » Patch (to be ported)

Let's use this issue for tracking the port and handle any bugs in new issues.

infojunkie’s picture

@jjwhitney, can't reproduce your scenario with single action and merging action form into node selection.

bojanz’s picture

Status: Patch (to be ported) » Fixed

Done.

Status: Fixed » Closed (fixed)

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