Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Efflux: Avoid generating error logs by installer.pl #583

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Kernel/Modules/Installer.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1154,8 +1154,9 @@ sub ConnectToDB {
);
}

# Connect to the database without logging errors, as they are already shown to the user.
my $DBH = DBI->connect(
$Param{DSN}, $Param{DBUser}, $Param{DBPassword},
$Param{DSN}, $Param{DBUser}, $Param{DBPassword}, { PrintError => 0 }
);

if ( !$DBH ) {
Expand Down
16 changes: 11 additions & 5 deletions Kernel/Output/HTML/Layout.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1310,7 +1310,9 @@ sub Header {

# Generate the minified CSS and JavaScript files and the tags referencing them (see LayoutLoader)
$Self->LoaderCreateAgentCSSCalls();
$Self->LoaderCreateDynamicCSS();
if ( !$Self->{InstallerOnly} ) {
$Self->LoaderCreateDynamicCSS();
}

my %AgentLogo;

Expand Down Expand Up @@ -1758,10 +1760,14 @@ sub Footer {
}

# Set an array with pending states.
my @PendingStateIDs = $Kernel::OM->Get('Kernel::System::State')->StateGetStatesByType(
StateType => [ 'pending reminder', 'pending auto' ],
Result => 'ID',
);
my @PendingStateIDs;

if ( !$Self->{InstallerOnly} ) {
@PendingStateIDs = $Kernel::OM->Get('Kernel::System::State')->StateGetStatesByType(
StateType => [ 'pending reminder', 'pending auto' ],
Result => 'ID',
);
}

# add JS data
my %JSConfig = (
Expand Down
6 changes: 5 additions & 1 deletion Kernel/System/Package.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2571,7 +2571,11 @@ sub PackageInstallDefaultFiles {
# get main object
my $MainObject = $Kernel::OM->Get('Kernel::System::Main');

my $Directory = $Self->{ConfigObject}->Get('Home') . '/var/packages';
my $Directory = $Self->{ConfigObject}->Get('Home') . '/var/packages';

# Return if the directory does not exist.
return if !-e $Directory;

my @PackageFiles = $MainObject->DirectoryRead(
Directory => $Directory,
Filter => '*.opm',
Expand Down
Loading