Skip to content

Commit 946281d

Browse files
author
Damyon Wiese
committed
MDL-56958 ajax: Prefer the general renderer
1 parent 0b8e0c3 commit 946281d

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

lib/ajax/service.php

+2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
require_once(__DIR__ . '/../../config.php');
3333
require_once($CFG->libdir . '/externallib.php');
3434

35+
define('PREFERRED_RENDERER_TARGET', RENDERER_TARGET_GENERAL);
36+
3537
$rawjson = file_get_contents('php://input');
3638

3739
$requests = json_decode($rawjson, true);

lib/outputfactories.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,9 @@ protected function get_target_suffix($target) {
137137
// If the target hasn't been specified we need to guess the defaults.
138138
// We also override the target with the default if the maintenance target has been provided.
139139
// This ensures we don't use the maintenance renderer if we are processing a special target.
140-
if (CLI_SCRIPT) {
140+
if (defined('PREFERRED_RENDERER_TARGET')) {
141+
$target = PREFERRED_RENDERER_TARGET;
142+
} else if (CLI_SCRIPT) {
141143
$target = RENDERER_TARGET_CLI;
142144
} else if (AJAX_SCRIPT) {
143145
$target = RENDERER_TARGET_AJAX;

0 commit comments

Comments
 (0)