fix captcha for reverts

Ticket

+commit
 

Looks like captcha breaks when trying to save an old version as current.

 

 

Went to http://2009rcc.org/wagn/Sandbox and looked at an old version, and when i clicked on "Save as current" got:

 

notice = getNextElement(getSlotFromContext('main_1'),'notice'); notice.update('

Rats. Issue with SANDBOX card:</h2>

CAPTCHA: is needed to verify that you\'re human</p></div>'); document.getElementById('dynamic_recaptcha-sandbox').innerHTML='loading captcha'; Recaptcha.create('6LfL2AgAAAAAALPrPq0gMHY7M89bUiwYsZvTp2TX', document.getElementById('dynamic_recaptcha-sandbox'),RecaptchaOptions);

 

ooh, good catch.

 

Not a huge surprise that that happens, but I never considered it.

 

I wish we could somehow detect when we're getting this javascript in the wrong context and fail hoptoadally.


- made this a ticket (from a support ticket)

- added to wagn 1.4; if not simple we should move it to Wagn 1.7

- resisted temptation to change "reverts" to "perverts".

  --Ethan McCutchen.....Wed Apr 14 11:10:38 -0700 2010


this is not easy, so we took away rollback for anonymous users for now. also fixed it so there's no "save as current" on the current revision. moving off of current release.

  --Ethan McCutchen.....Fri Apr 16 18:01:41 -0700 2010


on second thought, we decided to let users do rollback but take off the captcha check. for now.

  --Ethan McCutchen.....Fri Apr 16 18:05:18 -0700 2010


I have to completely do the captcha system in 1.8. May as well tag this on.

  --Ethan McCutchen.....Thu Dec 01 13:21:45 -0800 2011


ok, I've actually refactored captcha completely now. I wrote a custom handling in js and moved the verification from the controller to model validations. It works in edit type and edit name but does not work with rollback, which would be a good bit trickier because it's not a form.

 

I'm inclined to say that rather than rolling back immediately when we click "rollback", we should go to the edit form with that version's content, updating only when we save. The captcha would, of course, still work there.

 

In the meantime, I've made it so the rollback option disappears when you would otherwise need to use a captcha.

  --Ethan McCutchen.....Fri Dec 16 21:47:58 -0800 2011