Repository navigation
Remove the pre_header_initialize and header methods from the WeBWorK::ContentGenerator package. - #3263
Open
drgrice1 wants to merge 1 commit into
Open
Remove the pre_header_initialize and header methods from the WeBWorK::ContentGenerator package.#3263drgrice1 wants to merge 1 commit into
pre_header_initialize and header methods from the WeBWorK::ContentGenerator package.#3263drgrice1 wants to merge 1 commit into
Conversation
…WorK::ContentGenerator` package. This is something I have been intending to do since the conversion to Mojolicious. There is no need for a `pre_header_initialize` and `initialize` method anymore. Just one is needed. Furthermore, the name `pre_header_initialize` no longer has the meaning it was named for. That being an initialization before the header. The header is no longer set like it was with modperl and this method is not before that. Technically the `initialize` method is removed and the `pre_header_initialize` method renamed to the `initialize` method in terms of when the method is called from the `WeBWorK::ContentGenerator::go` method. The only real difference between the methods is that the `reply_with_file` or `reply_with_redirect` methods had to be called from the `pre_header_initialize` method, and would not work from the `initialize` method. For most `WeBWorK::ContentGenerator` subclasses all that was needed was to rename the `pre_header_initialize` method to `initialize`. However, there were a few that called both methods, and so the contents of the two methods had to be carefully merged to preserve calling order and properly handle early returns. As to the `header` method, it has done nothing since the conversion to Mojolicious. Its return value is entirely ignored and nothing overrides it.
drgrice1
force-pushed
the
remove-pre-header-initialize
branch
from
October 30, 2026 20:35
aa6651c to
e9a5b20
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is something I have been intending to do since the conversion to Mojolicious. There is no need for a
pre_header_initializeandinitializemethod anymore. Just one is needed. Furthermore, the namepre_header_initializeno longer has the meaning it was named for. That being an initialization before the header. The header is no longer set like it was with modperl and this method is not before that.Technically the
initializemethod is removed and thepre_header_initializemethod renamed to theinitializemethod in terms of when the method is called from theWeBWorK::ContentGenerator::gomethod. The only real difference between the methods is that thereply_with_fileorreply_with_redirectmethods had to be called from thepre_header_initializemethod, and would not work from theinitializemethod.For most
WeBWorK::ContentGeneratorsubclasses all that was needed was to rename thepre_header_initializemethod toinitialize. However, there were a few that called both methods, and so the contents of the two methods had to be carefully merged to preserve calling order and properly handle early returns.As to the
headermethod, it has done nothing since the conversion to Mojolicious. Its return value is entirely ignored and nothing overrides it.