Item13807: UI::Preview doesn't pass $topicObject to afterEditHandler.
Priority: Normal
Current State: Closed
Released In: 2.0.3
Target Release: patch
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