Chrome browser availability check for RHEL/CentOS

Bug #1871718 reported by Mitsuhiro Yoshida
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Medium
Unassigned

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');
                }
            }

Tags: export
Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/10872

Robert Lyon (robertl-9)
Changed in mahara:
status: New → In Progress
Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/10872
Committed: https://git.mahara.org/mahara/mahara/commit/2613dc3a6387cccdabbd10375df7b1cd79c6392f
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit 2613dc3a6387cccdabbd10375df7b1cd79c6392f
Author: Mitsuhiro Yoshida <email address hidden>
Date: Thu Apr 9 06:46:04 2020 +0900

Bug 1871718: Chrome browser availability check for RHEL/CentOS

behatnotneeded

Change-Id: I07fd774acbc41687d77b3379a19b9b15944208e0

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "20.04_STABLE" branch: https://reviews.mahara.org/10903

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/10903
Committed: https://git.mahara.org/mahara/mahara/commit/d60ec5790756abe199775774bf32ee2172c0cd05
Submitter: Robert Lyon (<email address hidden>)
Branch: 20.04_STABLE

commit d60ec5790756abe199775774bf32ee2172c0cd05
Author: Mitsuhiro Yoshida <email address hidden>
Date: Thu Apr 9 06:46:04 2020 +0900

Bug 1871718: Chrome browser availability check for RHEL/CentOS

behatnotneeded

Change-Id: I07fd774acbc41687d77b3379a19b9b15944208e0
(cherry picked from commit 2613dc3a6387cccdabbd10375df7b1cd79c6392f)

Robert Lyon (robertl-9)
Changed in mahara:
milestone: 20.04rc1 → 20.04.0
status: In Progress → Fix Committed
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.