Item12926: Subscribe links on top and bottom bar fail with validation errors
Current State: Closed
Released In: 1.2.0
Target Release: minor
Applies To: Extension
These buttons need the "subscribe_button" class added, so that the SubscribePlugin
- 30 May 2014
I added the subscribe_button class to the links by updating
However this doesn't seem to accomplish converting the GET to a POST.
I get the following js error:
Timestamp: 06/01/2014 07:44:20 PM
Error: TypeError: form is undefined
- 01 Jun 2014
Adding the subscribe_button class isn't enough. It requires a form around the button, in order to pass the strikeone validation key. This form is serialized and sent with the POST.
Of course the JS could be rewritten to avoid this, though it would still have to reap the strikeone key from some other form on the page.
- 08 Jun 2014
pointed out that not all pages have a form available to harvest. The simple fix is to allow get URLs to subscribe / unsubscribe. Since this can only be used by a logged in user and has minimal impact, it's probably okay to relax the rest restriction for this extension.
- 21 Jul 2014
I've got a couple of issues:
- The subscribe / unsubscribe when executed as a get URL result in a json response to the browser. this will be confusing. I the request is a get, then the rest handler probably ought to reply with an oops message so that the user can click to get back to the original page.
- There is an issue in UI::Rest. If you use a GET request, validation is still verified. Since validation only is applicable to POST type requests, we can probably skip validation for GET requests provided that GET is allowed.
- 22 Jul 2014
Because HTML doesn't support forms inside forms, using a form will never work for the variety of top and bottom bar implementations we have. So I recoded it to use a "special" validation token reserved for the use of the plugin.
- 24 Nov 2014 - 17:59