[Rt-commit] rt branch, 5.0/update-rt-core-so-article-templates-work, created. rt-5.0.1-10-ga88be5133d
Dianne Skoll
dianne at bestpractical.com
Thu Feb 4 12:03:03 EST 2021
The branch, 5.0/update-rt-core-so-article-templates-work has been created
at a88be5133df3d40fe679ede26259ffa45a45e2df (commit)
- Log -----------------------------------------------------------------
commit a88be5133df3d40fe679ede26259ffa45a45e2df
Author: Dianne Skoll <dianne at bestpractical.com>
Date: Thu Feb 4 12:01:42 2021 -0500
Update core RT so $Ticket is passed to RT::Extension::ArticleTemplates
There were substantial changes from 4.4 to 5.0; one of the effects
was that the RT::Extension::ArticleTemplates extension no longer had
access to the $Ticket object, so any template referring to $Ticket
would break. This commit passes $Ticket down the layers so the extension
can get at it.
diff --git a/share/html/Articles/Elements/BeforeMessageBox b/share/html/Articles/Elements/BeforeMessageBox
index 50fa9f9081..1d5edb857f 100644
--- a/share/html/Articles/Elements/BeforeMessageBox
+++ b/share/html/Articles/Elements/BeforeMessageBox
@@ -53,7 +53,7 @@
% unless (RT->Config->Get('HideArticleSearchOnReplyCreate')) {
<div class="form-row">
<div class="form-group label col-2"><&|/l&>Include Article:</&></div>
- <div class="value col-9"><& /Elements/SelectArticle, QueueObj => $QueueObj, AutoSubmit => 1 &></div>
+ <div class="value col-9"><& /Elements/SelectArticle, Ticket => $ticket, QueueObj => $QueueObj, AutoSubmit => 1 &></div>
</div>
% }
% if ( @$topics ) {
@@ -100,8 +100,9 @@
<%init>
my $QueueObj = $ARGS{QueueObj};
-if ( $ARGS{id} && $ARGS{id} ne 'new' && !$QueueObj ) {
- my $ticket = RT::Ticket->new( $session{CurrentUser} );
+my $ticket;
+if ( $ARGS{id} && $ARGS{id} ne 'new' ) {
+ $ticket = RT::Ticket->new( $session{CurrentUser} );
$ticket->Load( $ARGS{id} );
$QueueObj = $ticket->QueueObj;
}
diff --git a/share/html/Articles/Elements/IncludeArticle b/share/html/Articles/Elements/IncludeArticle
index 35bd618e52..177dcde41c 100644
--- a/share/html/Articles/Elements/IncludeArticle
+++ b/share/html/Articles/Elements/IncludeArticle
@@ -79,7 +79,7 @@ if ( $ret && $article->Id ){
}
my $formatted_article = $m->scomp('/Articles/Article/Elements/Preformatted',
- Article => $article
+ Article => $article, Ticket => $Ticket, QueueObj => $QueueObj
);
$m->callback( Article => $article, Ticket => $Ticket, formatted_article => \$formatted_article, ARGSRef => \%ARGS );
@@ -99,4 +99,5 @@ else {
<%ARGS>
$IncludeArticleId => undef
$QueueObj => undef
+$Ticket => undef
</%ARGS>
diff --git a/share/html/Elements/MessageBox b/share/html/Elements/MessageBox
index 1c199816a6..6432998e47 100644
--- a/share/html/Elements/MessageBox
+++ b/share/html/Elements/MessageBox
@@ -46,7 +46,7 @@
%#
%# END BPS TAGGED BLOCK }}}
<textarea autocomplete="off" class="form-control messagebox <% $Type eq 'text/html' ? 'richtext' : '' %>" <% $SuppressAttachmentWarning ? 'suppress-attachment-warning' : '' %> <% $width_attr %>="<% $Width %>" rows="<% $Height %>" <% $wrap_type |n %> name="<% $Name %>" id="<% $Name %>" placeholder="<% $Placeholder %>">
-% $m->comp('/Articles/Elements/IncludeArticle', %ARGS, IncludeArticleId => $article_id, QueueObj => $QueueObj) if $IncludeArticle;
+% $m->comp('/Articles/Elements/IncludeArticle', %ARGS, IncludeArticleId => $article_id, QueueObj => $QueueObj, Ticket => $Ticket) if $IncludeArticle;
% $m->callback( %ARGS, SignatureRef => \$signature, DefaultRef => \$Default, MessageRef => \$message );
% if (RT->Config->Get("SignatureAboveQuote", $session{'CurrentUser'})) {
<% $Default || '' %><% $signature %><% $message %></textarea>
@@ -137,4 +137,5 @@ $SuppressAttachmentWarning => 0
$Placeholder => loc('Type your message here')
$IncludeDefaultArticle => 0 # Preload a default article based on queue settings
$QueueObj => undef
+$Ticket => undef
</%ARGS>
diff --git a/share/html/Elements/SelectArticle b/share/html/Elements/SelectArticle
index e503da7124..f9cf00f960 100644
--- a/share/html/Elements/SelectArticle
+++ b/share/html/Elements/SelectArticle
@@ -90,4 +90,5 @@ $Name => 'IncludeArticleId'
$Default => ''
$AutoSubmit => 0
$IncludeSummary => 1
+$Ticket
</%ARGS>
-----------------------------------------------------------------------
More information about the rt-commit
mailing list