[Rt-commit] rt branch, 4.6/log-view-db-config-change-history, created. rt-4.4.4-696-gee7a01114e
Aaron Trevena
ast at bestpractical.com
Tue Feb 11 06:16:30 EST 2020
The branch, 4.6/log-view-db-config-change-history has been created
at ee7a01114e423bb56029e5d82649608c3fb2bc45 (commit)
- Log -----------------------------------------------------------------
commit b5ddf186d34970808f637bc62733d906bf417729
Author: Aaron Trevena <ast at bestpractical.com>
Date: Tue Jan 14 18:24:45 2020 +0000
Schema updates for tracking db configuration changes in transactions
diff --git a/etc/schema.Oracle b/etc/schema.Oracle
index b71b41d9d4..16b01eda69 100644
--- a/etc/schema.Oracle
+++ b/etc/schema.Oracle
@@ -112,7 +112,7 @@ CREATE TABLE Transactions (
ObjectId NUMBER(11,0) DEFAULT 0 NOT NULL,
TimeTaken NUMBER(11,0) DEFAULT 0 NOT NULL,
Type VARCHAR2(20),
- Field VARCHAR2(40),
+ Field VARCHAR2(255),
OldValue VARCHAR2(255),
NewValue VARCHAR2(255),
ReferenceType VARCHAR2(255),
@@ -552,6 +552,5 @@ CREATE TABLE Configurations (
LastUpdated DATE
);
-CREATE UNIQUE INDEX Configurations1 ON Configurations (LOWER(Name));
-CREATE INDEX Configurations2 ON Configurations (Disabled);
+CREATE INDEX Configurations1 ON Configurations (LOWER(Name), Disabled);
diff --git a/etc/schema.Pg b/etc/schema.Pg
index eda93108df..6f35902fcc 100644
--- a/etc/schema.Pg
+++ b/etc/schema.Pg
@@ -189,18 +189,16 @@ CREATE TABLE Transactions (
ObjectId integer NOT NULL DEFAULT 0 ,
TimeTaken integer NOT NULL DEFAULT 0 ,
Type varchar(20) NULL ,
- Field varchar(40) NULL ,
+ Field varchar(255) NULL ,
OldValue varchar(255) NULL ,
NewValue varchar(255) NULL ,
ReferenceType varchar(255) NULL,
OldReference integer NULL ,
NewReference integer NULL ,
Data varchar(255) NULL ,
-
Creator integer NOT NULL DEFAULT 0 ,
- Created TIMESTAMP NULL ,
+ Created TIMESTAMP NULL,
PRIMARY KEY (id)
-
);
CREATE INDEX Transactions1 ON Transactions (ObjectType, ObjectId);
@@ -793,6 +791,5 @@ CREATE TABLE Configurations (
PRIMARY KEY (id)
);
-CREATE UNIQUE INDEX Configurations1 ON Configurations (LOWER(Name));
-CREATE INDEX Configurations2 ON Configurations (Disabled);
+CREATE INDEX Configurations1 ON Configurations (LOWER(Name), Disabled);
diff --git a/etc/schema.SQLite b/etc/schema.SQLite
index b6e0166345..9cd81d15f2 100644
--- a/etc/schema.SQLite
+++ b/etc/schema.SQLite
@@ -121,17 +121,15 @@ CREATE TABLE Transactions (
ObjectId integer NULL DEFAULT 0 ,
TimeTaken integer NULL DEFAULT 0 ,
Type varchar(20) collate NOCASE NULL ,
- Field varchar(40) collate NOCASE NULL ,
+ Field varchar(255) collate NOCASE NULL ,
OldValue varchar(255) collate NOCASE NULL ,
NewValue varchar(255) collate NOCASE NULL ,
ReferenceType varchar(255) collate NOCASE NULL ,
OldReference integer NULL ,
NewReference integer NULL ,
Data varchar(255) collate NOCASE NULL ,
-
Creator integer NULL DEFAULT 0 ,
- Created DATETIME NULL
-
+ Created DATETIME NULL
) ;
CREATE INDEX Transactions1 ON Transactions (ObjectType, ObjectId);
@@ -582,6 +580,5 @@ CREATE TABLE Configurations (
LastUpdated timestamp DEFAULT NULL
);
-CREATE UNIQUE INDEX Configurations1 ON Configurations (Name);
-CREATE INDEX Configurations2 ON Configurations (Disabled);
+CREATE INDEX Configurations1 ON Configurations (Name, Disabled);
diff --git a/etc/schema.mysql b/etc/schema.mysql
index 1d6da82c59..9d2afa703c 100644
--- a/etc/schema.mysql
+++ b/etc/schema.mysql
@@ -108,14 +108,13 @@ CREATE TABLE Transactions (
ObjectId integer NOT NULL DEFAULT 0 ,
TimeTaken integer NOT NULL DEFAULT 0 ,
Type varchar(20) CHARACTER SET ascii NULL,
- Field varchar(40) CHARACTER SET ascii NULL,
+ Field varchar(255) CHARACTER SET ascii NULL,
OldValue varchar(255) NULL ,
NewValue varchar(255) NULL ,
ReferenceType varchar(255) CHARACTER SET ascii NULL,
OldReference integer NULL ,
NewReference integer NULL ,
Data varchar(255) NULL ,
-
Creator integer NOT NULL DEFAULT 0 ,
Created DATETIME NULL ,
PRIMARY KEY (id)
@@ -573,6 +572,5 @@ CREATE TABLE Configurations (
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-CREATE UNIQUE INDEX Configurations1 ON Configurations (Name);
-CREATE INDEX Configurations2 ON Configurations (Disabled);
+CREATE INDEX Configurations1 ON Configurations (Name, Disabled);
diff --git a/etc/upgrade/4.5.1/schema.Oracle b/etc/upgrade/4.5.1/schema.Oracle
index d275ae92bf..92dd231e11 100644
--- a/etc/upgrade/4.5.1/schema.Oracle
+++ b/etc/upgrade/4.5.1/schema.Oracle
@@ -11,5 +11,9 @@ CREATE TABLE Configurations (
LastUpdated DATE
);
-CREATE UNIQUE INDEX Configurations1 ON Configurations (LOWER(Name));
-CREATE INDEX Configurations2 ON Configurations (Disabled);
+CREATE INDEX Configurations1 ON Configurations (LOWER(Name), Disabled);
+
+-- Add transaction support for new config in database feature
+ALTER TABLE Transactions MODIFY Field VARCHAR2(255);
+
+
diff --git a/etc/upgrade/4.5.1/schema.Pg b/etc/upgrade/4.5.1/schema.Pg
index eecba576b2..cd52d4113f 100644
--- a/etc/upgrade/4.5.1/schema.Pg
+++ b/etc/upgrade/4.5.1/schema.Pg
@@ -12,5 +12,9 @@ CREATE TABLE Configurations (
PRIMARY KEY (id)
);
-CREATE UNIQUE INDEX Configurations1 ON Configurations (LOWER(Name));
-CREATE INDEX Configurations2 ON Configurations (Disabled);
+CREATE INDEX Configurations1 ON Configurations (LOWER(Name), Disabled);
+
+-- Add transaction support for new config in database feature
+ALTER TABLE Transactions MODIFY Field VARCHAR(255) NULL;
+
+
diff --git a/etc/upgrade/4.5.1/schema.SQLite b/etc/upgrade/4.5.1/schema.SQLite
index a8f280d334..3fe12fa291 100644
--- a/etc/upgrade/4.5.1/schema.SQLite
+++ b/etc/upgrade/4.5.1/schema.SQLite
@@ -10,6 +10,8 @@ CREATE TABLE Configurations (
LastUpdated timestamp DEFAULT NULL
);
-CREATE UNIQUE INDEX Configurations1 ON Configurations (Name);
-CREATE INDEX Configurations2 ON Configurations (Disabled);
+CREATE INDEX Configurations1 ON Configurations (Name, Disabled);
+
+-- Add transaction support for new config in database feature
+ALTER TABLE Transactions MODIFY Field VARCHAR(255) collate NOCASE NULL;
diff --git a/etc/upgrade/4.5.1/schema.mysql b/etc/upgrade/4.5.1/schema.mysql
index 80eda81134..5669f46ebe 100644
--- a/etc/upgrade/4.5.1/schema.mysql
+++ b/etc/upgrade/4.5.1/schema.mysql
@@ -11,5 +11,7 @@ CREATE TABLE Configurations (
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-CREATE UNIQUE INDEX Configurations1 ON Configurations (Name);
-CREATE INDEX Configurations2 ON Configurations (Disabled);
+CREATE INDEX Configurations1 ON Configurations (Name, Disabled);
+
+-- Add transaction support for new config in database feature
+ALTER TABLE Transactions MODIFY Field VARCHAR(255) CHARACTER SET ascii DEFAULT NULL;
\ No newline at end of file
commit ee7a01114e423bb56029e5d82649608c3fb2bc45
Author: Aaron Trevena <ast at bestpractical.com>
Date: Tue Feb 4 13:40:10 2020 +0000
Log DB config changes as transactions
Implementation of storing Configuration change history in transactions
Added page to view transaction log or configurations
diff --git a/lib/RT/Config.pm b/lib/RT/Config.pm
index 9a71a48b81..09c117c8d0 100644
--- a/lib/RT/Config.pm
+++ b/lib/RT/Config.pm
@@ -2536,7 +2536,7 @@ sub LoadConfigFromDatabase {
$database_config_cache_time = time;
my $settings = RT::Configurations->new(RT->SystemUser);
- $settings->UnLimit;
+ $settings->Limit( FIELD => 'Disabled', VALUE => 0);
my %seen;
diff --git a/lib/RT/Configuration.pm b/lib/RT/Configuration.pm
index 0d7c3ddf68..3092cfde54 100644
--- a/lib/RT/Configuration.pm
+++ b/lib/RT/Configuration.pm
@@ -147,20 +147,31 @@ sub Create {
$content = $self->loc('(no value)');
}
+ my $old_content_type;
if ( ref $old_value ) {
$old_value = $self->_SerializeContent($old_value);
+ $old_content_type = 'perl';
}
- RT->Logger->info(
- sprintf(
- '%s changed %s from "%s" to "%s"',
- $self->CurrentUser->Name,
- $self->Name,
- $old_value // '',
- $content // ''
- )
+ my ( $Trans, $Msg, $TransObj ) = $self->_NewTransaction(
+ Type => 'SetConfig',
+ Field => $self->Name,
+ ObjectType => 'RT::Configuration',
+ ObjectId => $self->id,
+ NewValue => ( $args{content_type} ) ? sprintf('%s value', $args{content_type}) : $content,
+ OldValue => ( $old_content_type ) ? sprintf('%s value', $old_content_type) : $old_value,
+ Data => $self->CurrentUser->Name . " created " . $self->Name,
+ ReferenceType => ref($self),
+ NewReference => $self->id,
);
- return ( $id, $self->loc( '[_1] changed from "[_2]" to "[_3]"', $self->Name, $old_value // '', $content // '' ) );
+
+ if ( RT->Config->Get('DevelMode') or not ($old_content_type || $args{content_type}) ) {
+ RT->Logger->info($self->CurrentUser->Name . " changed " . $self->Name . " from " . $old_value . " to " . $content);
+ return ($id, $self->loc('[_1] changed from "[_2]" to "[_3]"', $self->Name, $old_value // '', $content // ''));
+ } else {
+ RT->Logger->info($self->CurrentUser->Name . " changed " . $self->Name);
+ return ($id, $self->loc("[_1] changed", $self->Name));
+ }
}
=head2 CurrentUserCanSee
@@ -239,10 +250,24 @@ processes.
sub Delete {
my $self = shift;
return (0, $self->loc("Permission Denied")) unless $self->CurrentUserCanSee;
- my ($ok, $msg) = $self->SUPER::Delete(@_);
+ my $old_value = ( ref $self->Content ) ? sprintf('%s value', $self->ContentType) : $self->Content;
+ my ( $ok, $msg ) = $self->SetDisabled( 1 );
return ($ok, $msg) if !$ok;
RT->Config->ApplyConfigChangeToAllServerProcesses;
RT->Logger->info($self->CurrentUser->Name . " removed database setting for " . $self->Name);
+
+ my ( $Trans, $Msg, $TransObj ) = $self->_NewTransaction(
+ Type => 'DeleteConfig',
+ Field => $self->Name,
+ ObjectType => 'RT::Configuration',
+ ObjectId => $self->Id,
+ NewValue => $self->loc("Deleted"),
+ ReferenceType => ref($self),
+ OldReference => $self->id,
+ OldValue => $old_value,
+ Data => $self->CurrentUser->Name . " deleted " . $self->Name
+ );
+
return ($ok, $self->loc("Database setting removed."));
}
@@ -297,30 +322,40 @@ sub SetContent {
$content_type = 'perl';
}
- $RT::Handle->BeginTransaction;
+ ( $ok, $msg ) = $self->SetDisabled( 1 );
+ return ($ok, $msg) if !$ok;
- ($ok, $msg) = $self->_Set( Field => 'Content', Value => $value );
- if (!$ok) {
- $RT::Handle->Rollback;
- return ($ok, $self->loc("Unable to update [_1]: [_2]", $self->Name, $msg));
- }
+ my ( $new_id, $new_msg ) = $self->SUPER::Create(
+ Name => $self->Name,
+ Content => $value,
+ ContentType => $content_type,
+ Disabled => 0,
+ );
- if ($self->ContentType ne $content_type) {
- ($ok, $msg) = $self->_Set( Field => 'ContentType', Value => $content_type );
- if (!$ok) {
- $RT::Handle->Rollback;
- return ($ok, $self->loc("Unable to update [_1]: [_2]", $self->Name, $msg));
- }
+ unless ($new_id) {
+ return (0, $self->loc("Setting [_1] to [_2] failed: [_3]", $self->Name, $value, $new_msg));
}
- $RT::Handle->Commit;
RT->Config->ApplyConfigChangeToAllServerProcesses;
unless (defined($value) && length($value)) {
$value = $self->loc('(no value)');
}
- if (!ref($value) && !ref($old_value)) {
+ my ( $Trans, $Msg, $TransObj ) = $self->_NewTransaction(
+ Type => 'SetConfig',
+ Field => $self->Name,
+ ObjectType => 'RT::Configuration',
+ ObjectId => $new_id,
+ NewValue => ( $content_type ) ? sprintf('%s value', $content_type) : $value,
+ OldValue => ( $self->ContentType ) ? sprintf('%s value', $self->ContentType) : $self->Content,
+ Data => $self->CurrentUser->Name . " updated " . $self->Name,
+ ReferenceType => ref($self),
+ OldReference => $self->id,
+ NewReference => $new_id,
+ );
+
+ if ( RT->Config->Get('DevelMode') or not ($self->ContentType || $content_type) ) {
RT->Logger->info($self->CurrentUser->Name . " changed " . $self->Name . " from " . $old_value . " to " . $value);
return ($ok, $self->loc('[_1] changed from "[_2]" to "[_3]"', $self->Name, $old_value, $value));
} else {
diff --git a/lib/RT/Interface/Web/MenuBuilder.pm b/lib/RT/Interface/Web/MenuBuilder.pm
index 41b6b4c2c3..e82bab53b5 100644
--- a/lib/RT/Interface/Web/MenuBuilder.pm
+++ b/lib/RT/Interface/Web/MenuBuilder.pm
@@ -701,9 +701,10 @@ sub BuildMainNav {
$page->child( edit => raw_html => q[<a id="page-edit" class="menu-item" href="] . RT->Config->Get('WebPath') . qq[/Prefs/MyRT.html"><span class="fas fa-cog" alt="$alt" data-toggle="tooltip" data-placement="top" data-original-title="$alt"></span></a>] );
}
- if ( $request_path =~ m{^/Admin/Tools/(Configuration|EditConfig)} ) {
- $page->child( display => title => loc('View'), path => "/Admin/Tools/Configuration.html" );
- $page->child( history => title => loc('Edit'), path => "/Admin/Tools/EditConfig.html" );
+ if ( $request_path =~ m{^/Admin/Tools/(Configuration|EditConfig|ConfigHistory)} ) {
+ $page->child( "display", title => loc('View'), path => "/Admin/Tools/Configuration.html" );
+ $page->child( "modify", title => loc('Edit'), path => "/Admin/Tools/EditConfig.html" );
+ $page->child( "history", title => loc('History'), path => "/Admin/Tools/ConfigHistory.html" );
}
# due to historical reasons of always having been in /Elements/Tabs
diff --git a/lib/RT/Record.pm b/lib/RT/Record.pm
index 63500dace5..b224ae5475 100644
--- a/lib/RT/Record.pm
+++ b/lib/RT/Record.pm
@@ -1879,6 +1879,7 @@ sub CustomFieldLookupId {
return $self->Id unless @classes;
my $object = $self;
+ return $self->Id if (ref($object) eq 'RT::Configuration');
# Save a ->Load call by not calling ->FooObj->Id, just ->Foo
my $final = shift @classes;
foreach my $class (reverse @classes) {
diff --git a/lib/RT/Transaction.pm b/lib/RT/Transaction.pm
index b027ef6648..64f4a4fe92 100644
--- a/lib/RT/Transaction.pm
+++ b/lib/RT/Transaction.pm
@@ -135,8 +135,6 @@ sub Create {
return ( 0, $self->loc( "Transaction->Create couldn't, as you didn't specify an object type and id"));
}
-
-
#lets create our transaction
my %params = (
Type => $args{'Type'},
@@ -1377,6 +1375,44 @@ sub _CanonicalizeRoleName {
my $self = shift;
return "Attachment content modified";
},
+ # **** you are here, need to add SetConfig/CreateConfig and helper here, need to change from set/create
+ SetConfig => sub {
+ my $self = shift;
+ my $description = '<b>'.$self->Data.'</b><br>';
+ my $new_value = $self->NewValue;
+ my $old_value = $self->OldValue;
+
+ # pull in old value from reference if data structure
+ if ($old_value =~ m/^(perl|json).value$/) {
+ my $oldobj = RT::Configuration->new($self->CurrentUser);
+ $oldobj->Load($self->OldReference);
+ $old_value = $oldobj->Content;
+ }
+
+ # pull in new value from reference if data structure
+ if ($new_value =~ m/^(perl|json).value$/) {
+ my $newobj = RT::Configuration->new($self->CurrentUser);
+ $newobj->Load($self->NewReference);
+ $new_value = $newobj->Content;
+ }
+
+ $description .= $self->loc('[_1] changed from "[_2]" to "[_3]"', $self->Field, $old_value, $new_value);
+ return $description;
+ },
+ DeleteConfig => sub {
+ my $self = shift;
+ my $description = '<b>'.$self->Data.'</b><br>';
+ my $old_value = $self->OldValue;
+ # pull in old value from reference if data structure
+ if ($old_value =~ m/^(perl|json).value$/) {
+ my $oldobj = RT::Configuration->new($self->CurrentUser);
+ $oldobj->Load($self->OldReference);
+ $old_value = $oldobj->Content;
+ }
+
+ $description .= $self->loc('[_1] changed from "[_2]" to "[_3]"', $self->Field, $old_value, $self->loc("Deleted"));
+ return $description;
+ }
);
@@ -1628,7 +1664,15 @@ be passed to RT::CustomField->Create() via the 'LookupType' hash key.
sub CustomFieldLookupType {
- "RT::Queue-RT::Ticket-RT::Transaction";
+ my $self = shift;
+
+ # skip if it's a table/class with no custom fields
+ if (ref($self) && ($self->ObjectType =~ m/RT::(Configuration)/)) {
+ return "";
+ }
+ else {
+ return "RT::Queue-RT::Ticket-RT::Transaction";
+ }
}
@@ -1996,7 +2040,7 @@ sub _CoreAccessible {
Type =>
{read => 1, write => 1, sql_type => 12, length => 20, is_blob => 0, is_numeric => 0, type => 'varchar(20)', default => ''},
Field =>
- {read => 1, write => 1, sql_type => 12, length => 40, is_blob => 0, is_numeric => 0, type => 'varchar(40)', default => ''},
+ {read => 1, write => 1, sql_type => 12, length => 255, is_blob => 0, is_numeric => 0, type => 'varchar(255)', default => ''},
OldValue =>
{read => 1, write => 1, sql_type => 12, length => 255, is_blob => 0, is_numeric => 0, type => 'varchar(255)', default => ''},
NewValue =>
diff --git a/share/html/Admin/Tools/ConfigHistory.html b/share/html/Admin/Tools/ConfigHistory.html
new file mode 100644
index 0000000000..6cb6f325a5
--- /dev/null
+++ b/share/html/Admin/Tools/ConfigHistory.html
@@ -0,0 +1,86 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%#
+%# COPYRIGHT:
+%#
+%# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC
+%# <sales at bestpractical.com>
+%#
+%# (Except where explicitly superseded by other copyright notices)
+%#
+%#
+%# LICENSE:
+%#
+%# This work is made available to you under the terms of Version 2 of
+%# the GNU General Public License. A copy of that license should have
+%# been provided with this software, but in any event can be snarfed
+%# from www.gnu.org.
+%#
+%# This work is distributed in the hope that it will be useful, but
+%# WITHOUT ANY WARRANTY; without even the implied warranty of
+%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+%# General Public License for more details.
+%#
+%# You should have received a copy of the GNU General Public License
+%# along with this program; if not, write to the Free Software
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
+%#
+%#
+%# CONTRIBUTION SUBMISSION POLICY:
+%#
+%# (The following paragraph is not intended to limit the rights granted
+%# to you to modify and distribute this software under the terms of
+%# the GNU General Public License and is only of importance to you if
+%# you choose to contribute your changes and enhancements to the
+%# community by submitting them to Best Practical Solutions, LLC.)
+%#
+%# By intentionally submitting any modifications, corrections or
+%# derivatives to this work, or any other work intended for use with
+%# Request Tracker, to Best Practical Solutions, LLC, you confirm that
+%# you are the copyright holder for those contributions and you grant
+%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable,
+%# royalty-free, perpetual, license to use, copy, create derivative
+%# works based on those contributions, and sublicense and distribute
+%# those contributions and any derivatives thereof.
+%#
+%# END BPS TAGGED BLOCK }}}
+<%INIT>
+my $title = loc('System Configuration');
+unless ($session{'CurrentUser'}->HasRight( Object=> $RT::System, Right => 'SuperUser')) {
+ Abort(loc('This feature is only available to system administrators'));
+}
+
+# get the transactions?
+# start off just getting all of them!
+
+my $Transactions = RT::Transactions->new($session{CurrentUser});
+$Transactions->Limit(FIELD => 'ObjectType', VALUE => 'RT::Configuration');
+$Transactions->OrderBy(FIELD => 'Created', ORDER => 'DESC');
+</%INIT>
+<& /Admin/Elements/Header, Title => $title &>
+<& /Elements/Tabs &>
+ <div class="configuration">
+ <div class="history configurations" id="configurations">
+ <& /Widgets/TitleBoxStart, title => $title, class => 'fullwidth' &>
+ </div>
+<div class="history-container">
+% my $i = 1;
+% while (my $tx = $Transactions->Next()) {
+<& /Elements/ShowTransaction,
+ Transaction => $tx,
+ ShowHeaders => 1,
+ ShowDisplayModes => 0,
+ ShowActions => 1,
+ HasTxnCFs => 0,
+ RowNum => $i
+&>
+% $i++;
+% }
+</div>
+ </div>
+</div>
+<hr class="clear">
+</div>
+</div>
+
diff --git a/share/html/Admin/Tools/EditConfig.html b/share/html/Admin/Tools/EditConfig.html
index 603c46ce8c..a974e274e7 100644
--- a/share/html/Admin/Tools/EditConfig.html
+++ b/share/html/Admin/Tools/EditConfig.html
@@ -62,19 +62,6 @@ my $active_context = {
my @results;
-use Data::Dumper;
-my $stringify = sub {
- my $value = shift;
- return "" if !defined($value);
-
- local $Data::Dumper::Terse = 1;
- local $Data::Dumper::Indent = 2;
- local $Data::Dumper::Sortkeys = 1;
- my $output = Dumper $value;
- chomp $output;
- return $output;
-};
-
if (delete $ARGS{Update}) {
RT->Config->BeginDatabaseConfigChanges;
$RT::Handle->BeginTransaction;
@@ -140,14 +127,6 @@ if (delete $ARGS{Update}) {
my $setting = RT::Configuration->new($session{CurrentUser});
$setting->Load($key);
if ($setting->Id) {
- if ($setting->Disabled) {
- my ($ok, $msg) = $setting->SetDisabled(0);
- if (!$ok) {
- push @results, $msg;
- $has_error++;
- }
- }
-
my ($ok, $msg) = $setting->SetContent($val);
push @results, $msg;
$has_error++ if !$ok;
@@ -178,6 +157,7 @@ if (delete $ARGS{Update}) {
$RT::Handle->Commit;
}
RT->Config->EndDatabaseConfigChanges;
+ RT->Config->ApplyConfigChangeToAllServerProcesses unless ($has_error);
}
my $nav_type='tab'; # 'tab' or 'pill'
@@ -216,4 +196,4 @@ my $nav_type='tab'; # 'tab' or 'pill'
% }
</div><!-- content-all -->
</div><!-- titlebox-content -->
-</div><!-- configuration -->
\ No newline at end of file
+</div><!-- configuration -->
-----------------------------------------------------------------------
More information about the rt-commit
mailing list