MDL-78782 behat: optimize with editing mode step

The current I am on course homepage with editing mode loads twice the
course page. This patch prevents this from happening by going directly
to editmode.php.
This commit is contained in:
Ferran Recio
2023-07-26 16:19:57 +02:00
parent 533ce56743
commit dcd7261175
2 changed files with 19 additions and 16 deletions
+6 -1
View File
@@ -28,7 +28,12 @@ $setmode = optional_param('setmode', false, PARAM_BOOL);
$contextid = required_param('context', PARAM_INT);
$pageurl = required_param('pageurl', PARAM_LOCALURL);
require_sesskey();
// Behat requires JS to get the session. To allow goutte
// to enable edit mode sesskey validation is skipped for behat scripts.
if (!defined('BEHAT_SITE_RUNNING')) {
require_sesskey();
}
require_login();
$context = \context_helper::instance_by_id($contextid);