Commit 5d7b7fd
committed
Fix issue #2272.
Make sure that the `$userRecord` that is passed to the `fieldHTML`
method in `ProblemSetDetail.pm` exists before trying to access it.
Note the actual error occurs for the `counts_parent_grade` column of the
problem record which is the only problem record field that is of the
"choose" type (which is why this does not occur for non JITAR sets).
The earlier checks that the $userRecord exists are needed as the hacked
method of accessing the data directly via the hash key rather than using
the accessor turns the undefined value into a hash reference if that is
done. Then the check if the $userRecord exists in the "choose" case
later will fail because it will exist.
I don't know how long this bug has existed, but I know it goes back to
at least WeBWorK 2.17 (I suspect it goes back considerably further
though). The fieldHTML method in general needs a rewrite. There is to
much hackery in use there. The comment on lines 855-857 is about part
of what is causing this problem. That comment dates back to 2007, and
the problem it refers to goes back further.1 parent d8a32be commit 5d7b7fd
1 file changed
+6
-4
lines changedLines changed: 6 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
856 | 856 | | |
857 | 857 | | |
858 | 858 | | |
859 | | - | |
| 859 | + | |
860 | 860 | | |
861 | 861 | | |
862 | 862 | | |
| |||
865 | 865 | | |
866 | 866 | | |
867 | 867 | | |
868 | | - | |
| 868 | + | |
869 | 869 | | |
870 | 870 | | |
871 | 871 | | |
| |||
956 | 956 | | |
957 | 957 | | |
958 | 958 | | |
959 | | - | |
| 959 | + | |
| 960 | + | |
960 | 961 | | |
961 | 962 | | |
962 | 963 | | |
963 | | - | |
| 964 | + | |
| 965 | + | |
964 | 966 | | |
965 | 967 | | |
966 | 968 | | |
| |||
0 commit comments