Over at #51226-18: allow users to edit their own signup, Miglius suggests a confirmation form when users attempt to cancel their own signup. That seems like a reasonable thing to do regardless of how that other issue plays out, and it's mostly unrelated, so I'd rather handle it in a separate issue.

Comments

dww’s picture

Assigned: Unassigned » dww
Status: Active » Needs review
StatusFileSize
new1.19 KB

This is maybe slightly wonky, since I'm reusing the menu item at signup/cancel/[sid]/[token], since that's already setup perfectly with the confirm form and everything. But, it seems to work just fine, we have to redirect to a confirm form anyway, and I don't know that people look too closely to the URL during a confirm, anyway...

This patch will only apply after you apply http://drupal.org/files/issues/51226_edit_signup.22.patch from #51226-22: allow users to edit their own signup.

dww’s picture

greggles suggested converting cancel (the "secondary operation") from a button into a link, based on http://www.svennerberg.com/2008/09/the-use-of-buttons-in-web-forms and the fact that core does this for confirm forms generally. I'm not 100% sure I agree, since I think of this more like the "Delete" button on a node edit page... But, greggles points out:

greggles: the reason to have a "confirm" is to prevent a dataloss issue that might happen by accident
greggles: but you can reduce the accident from happening in the first place by making the buttons more distinct from each other

The good news is that it does simplify the code a bit, including some slightly yucky stuff from signup_edit_form.js...

So, I'll probably go this route, but I'd like to hear other feedback before I commit this.

Thanks!
-Derek

miglius’s picture

This patch works nicely for me.

dww’s picture

StatusFileSize
new4.42 KB

I noticed there were a few cases where the destination wasn't properly getting set. This should work better. I also changed the cancel confirm form itself so that if you land there with a destination set, the "Keep signup" link sends you back to your destination, too.

yoroy’s picture

Making cancel a text link is a good idea

But like greggles suggests, if this indeed *lowers* the change of this accidentally happening I would argue that *lessens* the need for an extra confirmation form :-)

"Are you sure…" forms are generally annoying. Mind that this 'feature' was only suggested beforehand in the previous thread, not because people reported actually getting a lot of duplicate signup emails through accidental unsubscribes (correct me if I'm wrong here). So I feel like you are fixing something that isn't broke yet.

geodaniel’s picture

I like the idea of the text link for this button, as it helps distinguish it from the main action. I think I'd be in favour of leaving an 'are you sure' form in there though. I'm not the biggest fan, but it is a destructive action, so I think it's good to include it still, much like in core.

dww’s picture

StatusFileSize
new4.44 KB

Whoops, I posted the wrong patch in #4. This one fixes the last of the destination bugs I found...

dww’s picture

Status: Needs review » Fixed

After further review/testing, committed to HEAD and D6--1.

dww’s picture

Tee hee, there was still another destination bug. ;) http://drupal.org/cvs?commit=166723

Status: Fixed » Closed (fixed)

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