cross
Foswiki General Assembly will be held on 28th November 2019, 1200 UTC on Freenode IRC channel #foswiki-association. See AgendaTenthGeneralAssembly

Item11447: CommentPlugin "noform" style examples don't work with new plugin

pencil
Priority: Normal
Current State: Closed
Released In: 1.2.0
Target Release: n/a
Applies To: Extension
Component: CommentPlugin
Branches: trunk
Reported By: GeorgeClark
Waiting For:
Last Change By: GeorgeClark
The last two noform examples in CommentPluginExamples don't work on the new version of the plugin. The examples still use the POST to the save script for their implementation.

I have one fix working - I think that there are probably a couple.

Just changing as a post to rest ran into issues with the topic= parameter prompted in the form. It's validated early in the rest script before the handler gets control. If it's not right, fully qualified with a web, the rest scripts throws a 400 error.

In order to move user input away from the topic= parameter so it's not user entered:
  • Added a comment_target field consistent with the other comment_ variables.
  • Rest handler validates comment_target and overrides the web and topic using it.
  • change form to post to rest/CommentPlugin/comment, send topic="%BASEWEB%.%BASETOPIC%", and use comment_target for user input.

Another solution would be to use javascript to validate the user input so that topic= is always valid to prevent rest failures.

-- GeorgeClark - 16 Jan 2012

I like that. JS is the right approach IMHO.

-- CrawfordCurrie - 28 Jan 2012

The comment_target option has been added to the examples and they are all working on 1.1 using the plugin I release to Extensions/Testing.

-- GeorgeClark - 30 Jan 2012

Cool. You have control.

-- CrawfordCurrie - 30 Jan 2012
 
Topic revision: r9 - 14 Oct 2012, GeorgeClark
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy