Question
APPROVALTRANSITION Variable is not appearing in controlled document despite appearing in the Preview
Hi,
I installed the Approval Plugin as that is exactly what our TWiki web is to be used for (only BS15000 rather than ISO 9000). Got the examples running fine but when I insert the variable %APPROVALTRANSITION% onto the example Controlled Document nothing appears. To quote the documentation:
"Now you can place the tag %APPROVALTRANSITION% in your document which will be expanded to either (a) a pull-down menu if the user can perform more than one transition, (b) a button if the current user can only perform one transition, or (c) empty space if the current user is not allowed to perform any action."
Since nothing was showing I had a
doh! moment and went back to the preferences to make sure I had the correct permissions.
Having checked the Workflow Approval Document and placed my ID in the preferences as being able to approve, reissue, etc I went back to the Controlled Document. I previewed the page and sure enough the 'Approval' button was now there,
however when I 'saved' the edit the approval button dissapeared again.
One thing to note is that when I checked the approval.pm all the lines referring to the variable %APPROVALTRANSITION% were commented out(!?!) - uncommenting them has unfortunately made no difference.
Environment
--
SteveMayes - 04 Mar 2005
...wow just re-read the above and although it is accurate, it is as clear as mud, I'd better clarify if I want any meaningful response.
- I have a variable that creates a dynamic link to other scripts (i.e. links to the actions permissable to that user).
- In preview mode the link appears as expected.
- but when the page is saved the link disappears.
--
SteveMayes - 07 Mar 2005
I am trying to use the approval plugin and it is behaving in the same way as you describe. I've posted some comments in the
ApprovalPluginDev topic relating to this issue. My last comment is included below.
At the top of the commonTagsHandler subroutine there are the following lines of code
if (NeedsApproval() && (my $query = TWiki::Func::getCgiQuery())) {
my $action = $query->param( 'APPROVALACTION' );
my $state = $query->param( 'APPROVALSTATE' );
I've put some debug trace on the variables and both action and state are unset. the result of this is that the nuber of actions is set to 0 and the if statement containing the button code is never entered.
When working in preview mode, the variables are set and the button appears correctly.
--
ChrisSBrown - 19 Oct 2005
Answer
IMHO these lines in ApprovalPlugin.pm never get true
94 if (($prefApprovalWorkflow = TWiki::Func::getPreferencesValue( "APPROVALWORKFLOW" )) &&
95 &TWiki::Store::topicExists( $globWebName, $prefApprovalWorkflow)) {
--
FerdinandGassauer - 04 Feb 2006