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

594 Fix formChild is null #595

Merged
merged 1 commit into from
Aug 29, 2024

Conversation

leonstr
Copy link
Contributor

@leonstr leonstr commented Aug 22, 2024

When a student completed a questionnaire then shown the "Thank you for completing this Questionnaire" page there was a JavaScript error:

Uncaught TypeError: formChild is null

This was because the JavaScript for the questions form was being inadvertently loaded for the Thank you page where this form is not present.

Copy link
Contributor

@mchurchward mchurchward left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will need to rebased with the latest MOODLE_401_STABLE so that only this PR's commit is present.

When a student completed a questionnaire then shown the "Thank you for
completing this Questionnaire" page there was a JavaScript error:

  Uncaught TypeError: formChild is null

This was because the JavaScript for the questions form was being
inadvertently loaded for the Thank you page where this form is not
present.
@leonstr leonstr force-pushed the 594-formchildnull-401 branch from 0f6ba48 to 31a3d4d Compare August 28, 2024 10:46
@leonstr
Copy link
Contributor Author

leonstr commented Aug 28, 2024

Apologies, rebased, hopefully this is correct now.

Edit: No it isn't. More apologies. I'll see if I can sort this out.

@leonstr
Copy link
Contributor Author

leonstr commented Aug 28, 2024

Maybe it is correct after all, please let me know if there are still issues with this.

@mchurchward
Copy link
Contributor

There was a fix added to the javascript here. This may already fix the problem you describe?

@leonstr
Copy link
Contributor Author

leonstr commented Aug 28, 2024

There was a fix added to the javascript here. This may already fix the problem you describe?

No, in fact this issue only occurs once that fix has been applied. Fix 852486f allows the form checker to be run with Moodle 4.4 (instead of getting a console error), but this means a long-time bug re-emerges due to the form checker being incorrectly loaded for the "Thank you" page. If in doubt, install the latest MOODLE_401_STABLE of mod_questoinnaire and follow the steps in #594.

@mchurchward
Copy link
Contributor

I don't get that error using the latest MOODLE_401_STABLE.

@leonstr
Copy link
Contributor Author

leonstr commented Aug 28, 2024

I don't get that error using the latest MOODLE_401_STABLE.

On the Thank You page? That's a mystery since there's no DOM element with the ID specified by the form checker code.

I've just retested, on Moodle 4.4.2+ (Build: 20240823) with mod_questionnaire 5c0dbe8 and still see the error if I follow the steps from #594 (slightly different error because it's a different browser):

typeerror

@mchurchward
Copy link
Contributor

Ah. Okay. I didn't realize you meant in the console. Yes, I do see that.

Copy link
Contributor

@mchurchward mchurchward left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the clarification.

@mchurchward mchurchward merged commit de5227b into PoetOS:MOODLE_401_STABLE Aug 29, 2024
4 of 5 checks passed
lucaboesch pushed a commit to lucaboesch/moodle-mod_questionnaire that referenced this pull request Aug 29, 2024
When a student completed a questionnaire then shown the "Thank you for
completing this Questionnaire" page there was a JavaScript error:

  Uncaught TypeError: formChild is null

This was because the JavaScript for the questions form was being
inadvertently loaded for the Thank you page where this form is not
present.
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

Successfully merging this pull request may close these issues.

2 participants