cross
New Foswiki release 2.1.6 is available with important security fixes.
Sourceforge foswiki email lists being discontinued. Subscribe to the new Foswiki announce and discuss lists at MailingLists
You are here: Foswiki>Tasks Web>Item13807 (16 Nov 2015, GeorgeClark)Edit Attach

Item13807: UI::Preview doesn't pass $topicObject to afterEditHandler.

pencil
Priority: Normal
Current State: Closed
Released In: 2.0.3
Target Release: patch
Applies To: Engine
Component: FoswikiUIPreview
Branches: master
Reported By: VadimBelman
Waiting For:
Last Change By: GeorgeClark
The patch is as simple as it could be:

--- a/core/lib/Foswiki/UI/Preview.pm
+++ b/core/lib/Foswiki/UI/Preview.pm
@@ -72,7 +72,7 @@ sub preview {
     }

     my $text = $topicObject->text() || '';
-    $session->{plugins}->dispatch( 'afterEditHandler', $text, $topic, $web );
+    $session->{plugins}->dispatch( 'afterEditHandler', $text, $topic, $web, $topicObject );

     # Load the template for the view
     my $content  = $text;
-- VadimBelman - 07 Oct 2015

Looks like the PluginHandlerTests don't really test the afterEditHander. They are all driven by calls to meta, or to render. It doesn't seem to run either the UI::Save or UI::Preview scripts, which call this handler.

The handler is also called directly from WysiwygPlugin

-- GeorgeClark - 08 Oct 2015

A brief look into Wysiwyg code reveals that it doesn't bother about meta whatsoever. But speaking about my case – Wysiwyg doesn't play good with code embedding anyway. I'd better think about avoiding any processing unless raw editor is being used.

-- VadimBelman - 08 Oct 2015
 

ItemTemplate edit

Summary UI::Preview doesn't pass $topicObject to afterEditHandler.
ReportedBy VadimBelman
Codebase 2.0.2, 2.0.1, 2.0.0, 1.1.9
SVN Range
AppliesTo Engine
Component FoswikiUIPreview
Priority Normal
CurrentState Closed
WaitingFor
Checkins distro:6e337f7cf87b
TargetRelease patch
ReleasedIn 2.0.3
CheckinsOnBranches master
trunkCheckins
masterCheckins distro:6e337f7cf87b
ItemBranchCheckins
Release01x01Checkins
Topic revision: r7 - 16 Nov 2015, GeorgeClark - This page was cached on 21 Mar 2018 - 13:26.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License