Commit 8c2f50f9 authored by Robert Lyon's avatar Robert Lyon
Browse files

Bug 1870993: Respect $cfg->usepdfexport value



If all other dependencies are met then it is possible to export by pdf
on new installs without $cfg->usepdfexport set

Change-Id: I7a61e88ba835609564f1aaeaa46be89b82bd8974
Signed-off-by: default avatarRobert Lyon <robertl@catalyst.net.nz>
parent 24e19042
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -15,7 +15,10 @@ $pdfactive = false;
if (db_table_exists('export_installed')) {
    $pdfactive = get_field('export_installed', 'active', 'name', 'pdf');
}
if ($pdfactive && !file_exists(get_config('docroot') . 'lib/chrome-php/headless-chromium-php-master/vendor/autoload.php')) {

$chromephpexists = file_exists(get_config('docroot') . 'lib/chrome-php/headless-chromium-php-master/vendor/autoload.php');
if (($pdfactive && !$chromephpexists) ||
    ($pdfactive && $chromephpexists && !get_config('usepdfexport'))) {
    global $SESSION;
    // need to disable the PDF export option
    execute_sql("UPDATE {export_installed} SET active = 0 WHERE name = ?", array('pdf'));