Description
Hi Richard,
CodeRunner is currently using the Twig library version 3.1.1 (2020-10-27). We are using another moodle plugin auth/saml2 (https://moodle.org/plugins/auth_saml2), which is using the updated version of Twig libraries, we currently have this library updated to 3.14.2 (2024-11-07) on our system. Since we have two Twig versions, this is causing an issue for us, since both versions of the libraries cannot be loaded together.
And some of the functions in the CodeRunner Twig libraries are now deprecated. Could you please have a look and suggest if you plan to update this to the newer version? It would be very helpful.
Steps to reproduce:
-
We hacked the code in coderunner/vendor/composer/autoload_static.php to use the new Twig library from auth/saml2
public static $prefixDirsPsr4 = [
'Twig\' =>
[
// because this and auth_saml2 both include Twig, auth_saml2 has newer now.
/*
0 => DIR . '/..' . '/twig/twig/src',
*/
0 => DIR . '/../../../../../auth/saml2/.extlib/simplesamlphp/vendor' . '/twig/twig/src',
], -
With this change, we noticed there were two phpunit tests failing.
test_randomised_sqr and test_randomised_sqr_with_seed.
Error:
qtype_coderunner\walkthrough_randomisation_test::test_randomised_sqr
Failed asserting that false is true.
/var/www/html/question/type/coderunner/tests/walkthrough_randomisation_test.php:69
/var/www/html/lib/phpunit/classes/advanced_testcase.php:72
- Also we get the undefined function twig_test_iterable() error when previewing the question with Twig preprocessor ( as this function is deprecated since Twig 3.8.0)
Thanks,
Anupama