Fix the change_user_id script for the case that a user does not have a password.#2950
Open
drgrice1 wants to merge 1 commit intoopenwebwork:WeBWorK-2.21from
Open
Fix the change_user_id script for the case that a user does not have a password.#2950drgrice1 wants to merge 1 commit intoopenwebwork:WeBWorK-2.21from
change_user_id script for the case that a user does not have a password.#2950drgrice1 wants to merge 1 commit intoopenwebwork:WeBWorK-2.21from
Conversation
…e a password.
It is now the case that a user is not required to have a password record
in the database. However, the `change_user_id` script was never updated
for that case. So an exception is thrown if the script is used for a
user that does not have a password record (for example a user created
via LTI authentication).
Note that perltidy has also been run on the file. The script does not
have the `.pl` extension and so the workflow doesn't check this file and
the `run-perltidy.pl` script doesn't attempt to format it. Hide
whitespace changes to see the important change (there is also some clean
up of the comments at the beginning of the file).
Also fix the check for the type of a database record in the `checkArgs`
method of `lib/WeBWorK/DB.pm`. Just because a variable is a `ref` does
not mean that it is an object for which the `isa` method can be called.
The proper check is `blessed $obj && $obj->isa('Package')`. Note the
defined check was unnecessary in any case. This prevented the error in
the script from giving more useful information. Instead it complained
about the inability to call `isa` when it should have given the intended
error message from this check.
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.
It is now the case that a user is not required to have a password record in the database. However, the
change_user_idscript was never updated for that case. So an exception is thrown if the script is used for a user that does not have a password record (for example a user created via LTI authentication).Note that perltidy has also been run on the file. The script does not have the
.plextension and so the workflow doesn't check this file and therun-perltidy.plscript doesn't attempt to format it. Hide whitespace changes to see the important change (there is also some clean up of the comments at the beginning of the file).Also fix the check for the type of a database record in the
checkArgsmethod oflib/WeBWorK/DB.pm. Just because a variable is arefdoes not mean that it is an object for which theisamethod can be called. The proper check isblessed $obj && $obj->isa('Package'). Note the defined check was unnecessary in any case. This prevented the error in the script from giving more useful information. Instead it complained about the inability to callisawhen it should have given the intended error message from this check.