Item8320: WORKFLOWHISTORYFORMAT setting in WebPreferences is ignored

pencil
Priority: Normal
Current State: Closed
Released In:
Target Release:
Applies To: Extension
Component: WorkflowPlugin
Branches:
Reported By: MartinKaufmann
Waiting For:
Last Change By: CrawfordCurrie
Using the latest version of the WorkflowPlugin ($Rev: 5325 (2009-10-19) $) I tried setting WORKFLOWHISTORYFORMAT in WebPreferences as
   * Set WORKFLOWPLUGIN_WORKFLOWHISTORYFORMAT = | $state | $wikiusername | $date |$n
This setting, however, was ignored and the default setting <br>$state -- $date was used instead. To fix it, I had to change ControlledTopic.pm as shown below. At the same time I also added the $rev variable to the history format to be able to display the respective revision in the workflow history: | <a href="%INCLUDINGTOPIC%?rev=$rev">$rev | $state | $wikiusername | $date |$n
--- ControlledTopic.pm.orig     2009-11-04 14:34:26.000000000 +0100
+++ ControlledTopic.pm  2009-11-04 20:20:38.000000000 +0100
@@ -162,12 +162,13 @@
     }

     $this->setState($state, $version);
-
-    my $fmt = Foswiki::Func::getPreferencesValue("WORKFLOWHISTORYFORMAT")
+
+    my $fmt = Foswiki::Func::getPreferencesValue("WORKFLOWPLUGIN_WORKFLOWHISTORYFORMAT")
       || '<br>$state -- $date';
     $fmt =~ s/\$wikiusername/Foswiki::Func::getWikiUserName()/geo;
     $fmt =~ s/\$state/$this->getState()/goe;
     $fmt =~ s/\$date/$this->{state}->{"LASTTIME_$state"}/geo;
+    $fmt =~ s/\$rev/$this->{state}->{"LASTVERSION_$state"}/geo;
     if ( defined &Foswiki::Func::decodeFormatTokens ) {

         # Compatibility note: also expands $percnt etc.

-- MartinKaufmann - 04 Nov 2009

That'll be because the setting is WORKFLOWHISTORYFORMAT, as documented, and not WORKFLOWPLUGIN_WORKFLOWHISTORYFORMAT. I'm not going to change that; plugin settings are an anachronism, and need getting rid of.

I added the rev feature.

-- CrawfordCurrie - 20 May 2010

I agree that plugin settings are an anachronism but I guess the following solution might be as compatible to all kinds of "standards" as possible:

my $fmt = Foswiki::Func::getPreferencesValue("WORKFLOWPLUGIN_WORKFLOWHISTORYFORMAT") ||
   Foswiki::Func::getPreferencesValue("WORKFLOWHISTORYFORMAT") ||
   '<br>$state -- $date';

-- MartinKaufmann - 20 May 2010

Are you saying that the plugin used to support WORKFLOWPLUGIN_WORKFLOWHISTORYFORMAT? If so, there's a case for the "compatibility mode" - otherwise, only the "modern" setting should be supported.

As far as I'm concerned, this is closed.

-- CrawfordCurrie - 21 May 2010
 

ItemTemplate edit

Summary WORKFLOWHISTORYFORMAT setting in WebPreferences is ignored
ReportedBy MartinKaufmann
Codebase 1.0.7
SVN Range Foswiki-1.0.7, Sun, 20 Sep 2009, build 5061
AppliesTo Extension
Component WorkflowPlugin
Priority Normal
CurrentState Closed
WaitingFor
Checkins WorkflowPlugin:0ea8ed5c0cbe
ReleasedIn
Topic revision: r7 - 22 May 2010, CrawfordCurrie
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