mahara-contributors team mailing list archive
-
mahara-contributors team
-
Mailing list archive
-
Message #58115
[Bug 1871718] Re: Chrome browser availability check for RHEL/CentOS
** Changed in: mahara
Milestone: 20.04rc1 => 20.04.0
** Changed in: mahara
Status: In Progress => Fix Committed
--
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1871718
Title:
Chrome browser availability check for RHEL/CentOS
Status in Mahara:
Fix Committed
Bug description:
Adding the following code, we can check Chrome browser installation on
Red Hat Enterprise Linux (RHEL) and CentOS environment (Related to Bug
#1871515).
File to modify:
export/pdf/lib.php
Line:
133
[Before]
/**
* Dumps all views into the HTML export
*/
private function pdf_view_export_data() {
global $pdfrun;
static $browser;
static $page;
$progressstart = 85;
$progressend = 95;
$i = 0;
$viewcount = count($this->views);
if (!isset($pdfrun) || $pdfrun == 'first' || $pdfrun == 'all') {
$browsertype = 'chromium-browser';
system('dpkg -l | grep ' . $browsertype, $error);
if ($error) {
$browsertype = 'chrome';
system('dpkg -l | grep ' . $browsertype, $error2);
if ($error2) {
throw new MaharaException('Need to have a Chrome browser installed to use the headless pdf option');
}
}
[After]
/**
* Dumps all views into the HTML export
*/
private function pdf_view_export_data() {
global $pdfrun;
static $browser;
static $page;
$progressstart = 85;
$progressend = 95;
$i = 0;
$viewcount = count($this->views);
if (system('command -v dpgk')) {
$command = 'dpkg -l';
} else {
$command = 'rpm -qa';
}
if (!isset($pdfrun) || $pdfrun == 'first' || $pdfrun == 'all') {
$browsertype = 'chromium-browser';
system($command . ' | grep ' . $browsertype, $error);
if ($error) {
$browsertype = 'chrome';
system($command . ' | grep ' . $browsertype, $error2);
if ($error2) {
throw new MaharaException('Need to have a Chrome browser installed to use the headless pdf option');
}
}
To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1871718/+subscriptions
References