Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot assign string to property core_question\output\question_version_info::$version of type int #113

Open
aspark21 opened this issue Apr 28, 2024 · 7 comments

Comments

@aspark21
Copy link

PHP8.1
Moodle 4.3 stable

New PHPUnit failures since Thursday. Seems it could be due to the core weekly release rather than the plugin update

qtype_gapfill.walkthrough_test/test_draggable_itemsqtype_gapfill\walkthrough_test::test_draggable_items 
TypeError: Cannot assign string to property core_question\output\question_version_info::$version of type int 
/var/www/html/question/classes/output/question_version_info.php:62 
/var/www/html/question/engine/renderer.php:150 
/var/www/html/question/engine/renderer.php:102 
/var/www/html/question/behaviour/behaviourbase.php:113 
/var/www/html/question/engine/questionattempt.php:912 
/var/www/html/question/engine/questionusage.php:483 
/var/www/html/question/engine/tests/helpers.php:921 
/var/www/html/question/engine/tests/helpers.php:986 
/var/www/html/question/type/gapfill/tests/walkthrough_test.php:61 
/var/www/html/lib/phpunit/classes/advanced_testcase.php:81

qtype_gapfill.walkthrough_test/test_dropdownsqtype_gapfill\walkthrough_test::test_dropdowns TypeError: Cannot assign string to 
property core_question\output\question_version_info::$version of type int  
/var/www/html/question/classes/output/question_version_info.php:62 
/var/www/html/question/engine/renderer.php:150 
/var/www/html/question/engine/renderer.php:102 
/var/www/html/question/behaviour/behaviourbase.php:113 
/var/www/html/question/engine/questionattempt.php:912 
/var/www/html/question/engine/questionusage.php:483 
/var/www/html/question/type/gapfill/tests/walkthrough_test.php:97 
/var/www/html/lib/phpunit/classes/advanced_testcase.php:81

qtype_gapfill.walkthrough_test/test_deferred_feedback_unansweredqtype_gapfill\walkthrough_test::test_deferred_feedback_unanswered 
TypeError: Cannot assign string to property core_question\output\question_version_info::$version of type int  
/var/www/html/question/classes/output/question_version_info.php:62 
/var/www/html/question/engine/renderer.php:150 
/var/www/html/question/engine/renderer.php:102 
/var/www/html/question/behaviour/behaviourbase.php:113 
/var/www/html/question/engine/questionattempt.php:912 
/var/www/html/question/engine/questionusage.php:483
/var/www/html/question/engine/tests/helpers.php:921 
/var/www/html/question/engine/tests/helpers.php:1012 
/var/www/html/question/type/gapfill/tests/walkthrough_test.php:123 
/var/www/html/lib/phpunit/classes/advanced_testcase.php:81

qtype_gapfill.walkthrough_test/test_interactive_with_correctqtype_gapfill\walkthrough_test::test_interactive_with_correct 
TypeError: Cannot assign string to property core_question\output\question_version_info::$version of type int  
/var/www/html/question/classes/output/question_version_info.php:62 /var/www/html/question/engine/renderer.php:150 
/var/www/html/question/engine/renderer.php:102 /var/www/html/question/behaviour/behaviourbase.php:113 
/var/www/html/question/engine/questionattempt.php:912 /var/www/html/question/engine/questionusage.php:483 
/var/www/html/question/engine/tests/helpers.php:921 /var/www/html/question/engine/tests/helpers.php:1012 
/var/www/html/question/type/gapfill/tests/walkthrough_test.php:316 /var/www/html/lib/phpunit/classes/advanced_testcase.php:81

qtype_gapfill.walkthrough_test/test_interactive_wildcard_with_correctqtype_gapfill\walkthrough_test::test_interactive_wildcard_with_correct 
TypeError: Cannot assign string to property core_question\output\question_version_info::$version of type int  
/var/www/html/question/classes/output/question_version_info.php:62 /var/www/html/question/engine/renderer.php:150 
/var/www/html/question/engine/renderer.php:102 /var/www/html/question/behaviour/behaviourbase.php:113 
/var/www/html/question/engine/questionattempt.php:912 /var/www/html/question/engine/questionusage.php:483 
/var/www/html/question/engine/tests/helpers.php:921 /var/www/html/question/engine/tests/helpers.php:1012 
/var/www/html/question/type/gapfill/tests/walkthrough_test.php:366 /var/www/html/lib/phpunit/classes/advanced_testcase.php:81

qtype_gapfill.walkthrough_test/test_interactive_discard_duplicatesqtype_gapfill\walkthrough_test::test_interactive_discard_duplicates 
TypeError: Cannot assign string to property core_question\output\question_version_info::$version of type int  
/var/www/html/question/classes/output/question_version_info.php:62 /var/www/html/question/engine/renderer.php:150 
/var/www/html/question/engine/renderer.php:102 /var/www/html/question/behaviour/behaviourbase.php:113 
/var/www/html/question/engine/questionattempt.php:912 /var/www/html/question/engine/questionusage.php:483 
/var/www/html/question/engine/tests/helpers.php:921 /var/www/html/question/engine/tests/helpers.php:1012 
/var/www/html/question/type/gapfill/tests/walkthrough_test.php:480 /var/www/html/lib/phpunit/classes/advanced_testcase.php:81

qtype_gapfill.walkthrough_test/test_interactive_grade_for_blankqtype_gapfill\walkthrough_test::test_interactive_grade_for_blank 
TypeError: Cannot assign string to property core_question\output\question_version_info::$version of type int  
/var/www/html/question/classes/output/question_version_info.php:62 /var/www/html/question/engine/renderer.php:150 
/var/www/html/question/engine/renderer.php:102 /var/www/html/question/behaviour/behaviourbase.php:113 
/var/www/html/question/engine/questionattempt.php:912 /var/www/html/question/engine/questionusage.php:483 
/var/www/html/question/engine/tests/helpers.php:921 /var/www/html/question/engine/tests/helpers.php:1012 
/var/www/html/question/type/gapfill/tests/walkthrough_test.php:570 /var/www/html/lib/phpunit/classes/advanced_testcase.php:81

qtype_gapfill.walkthrough_test/test_matching_divsqtype_gapfill\walkthrough_test::test_matching_divs 
TypeError: Cannot assign string to property core_question\output\question_version_info::$version of type int  
/var/www/html/question/classes/output/question_version_info.php:62 /var/www/html/question/engine/renderer.php:150 
/var/www/html/question/engine/renderer.php:102 /var/www/html/question/behaviour/behaviourbase.php:113 
/var/www/html/question/engine/questionattempt.php:912 /var/www/html/question/engine/questionusage.php:483 
/var/www/html/question/type/gapfill/tests/walkthrough_test.php:616 /var/www/html/lib/phpunit/classes/advanced_testcase.php:81

qtype_gapfill.walkthrough_test/test_get_aftergap_textqtype_gapfill\walkthrough_test::test_get_aftergap_text 
TypeError: Cannot assign string to property core_question\output\question_version_info::$version of type int  
/var/www/html/question/classes/output/question_version_info.php:62 /var/www/html/question/engine/renderer.php:150 
/var/www/html/question/engine/renderer.php:102 /var/www/html/question/behaviour/behaviourbase.php:113 
/var/www/html/question/engine/questionattempt.php:912 /var/www/html/question/engine/questionusage.php:483 
/var/www/html/question/type/gapfill/tests/walkthrough_test.php:642 /var/www/html/lib/phpunit/classes/advanced_testcase.php:81

qtype_gapfill.walkthrough_test/test_deferred_grade_for_blankqtype_gapfill\walkthrough_test::test_deferred_grade_for_blank 
TypeError: Cannot assign string to property core_question\output\question_version_info::$version of type int  
/var/www/html/question/classes/output/question_version_info.php:62 /var/www/html/question/engine/renderer.php:150 
/var/www/html/question/engine/renderer.php:102 /var/www/html/question/behaviour/behaviourbase.php:113 
/var/www/html/question/engine/questionattempt.php:912 /var/www/html/question/engine/questionusage.php:483 
/var/www/html/question/engine/tests/helpers.php:921 /var/www/html/question/engine/tests/helpers.php:1012 
/var/www/html/question/type/gapfill/tests/walkthrough_test.php:688 /var/www/html/lib/phpunit/classes/advanced_testcase.php:81
@marcusgreen
Copy link
Owner

Interesting, I will investigate

@aspark21
Copy link
Author

Found this where it was fixed in core:
https://tracker.moodle.org/browse/MDL-79507
moodle/moodle@f462a48

@aspark21
Copy link
Author

Quite likely to be due to this change
https://tracker.moodle.org/browse/MDL-80087
moodle/moodle@b7a7263

not that it helps with what a fix might look like

@marcusgreen
Copy link
Owner

I suspect it is a test failure rather than a plugin failure, but I am keen all my tests pass

@aspark21
Copy link
Author

full test run has now completed with MDL-80087 reverted and this resolves those failing tests, so that's definitely where it's coming from

@marcusgreen
Copy link
Owner

Hi Alistair, I am not entirely sure why the unit tests ever worked under PHP 8.2. However as a result of his commit
69988aa
They now work as expected on the CI. Can you confirm it works for you

@aspark21
Copy link
Author

Thanks Marcus!

Tests running now, results should be in in about 3.5h.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants