Skip to content

Fix Caliper::Entity calling nonexistent prHintsAfter() method#3050

Merged
Alex-Jordan merged 1 commit into
openwebwork:WeBWorK-2.21from
ubc:caliper-fixes
Jul 11, 2026
Merged

Fix Caliper::Entity calling nonexistent prHintsAfter() method#3050
Alex-Jordan merged 1 commit into
openwebwork:WeBWorK-2.21from
ubc:caliper-fixes

Conversation

@xcompass

@xcompass xcompass commented Jul 11, 2026

Copy link
Copy Markdown
Member

Summary

Caliper::Entity::problem_user() called $problem_user->prHintsAfter() to
populate the showHintsAfter event field, but the UserProblem record has
no prHintsAfter accessor — the field is showHintsAfter (used correctly
in problem() for the global problem). Generating a Caliper event for a
problem attempt would die with Can't locate object method prHintsAfter.
Call showHintsAfter() instead.

Notes

Rebased onto WeBWorK-2.21 and retargeted per review; the
Caliper::ResourceIri spelling commit was dropped in favor of #3044.

@Alex-Jordan

Copy link
Copy Markdown
Contributor

The typo part of this is included in #3044.

For the other part of this, could you open a PR targeting the WeBWorK-2.21 branch? We are releasing that at the end of this month. We are in a period where we don't really add things to develop branch, but will merge WeBWorK-2.21 into develop after the release.

@drgrice1

Copy link
Copy Markdown
Member

It seems that the prHintsAfter typo is my fault and happened in #1792. That is the only change in that file in the pull request, and I probably changed something in working in that file and meant to change it back and changed the wrong line.

Please rebase this onto the WeBWorK-2.21 branch (dropping all other commits), and then retarget to the WeBWorK-2.21 branch. Execute git rebase -i origin/WeBWorK-2.21 and change pick to drop for all commits except the second one in this pull request.

As @Alex-Jordan said, the resourse typo is fixed in #3044. So please remove this and only make the prHintsAfter change. The rebase instructions above will take care of this since it will drop the first commit that fixes this typo.

Caliper::Entity::problem_user() called $problem_user->prHintsAfter() to
populate the 'showHintsAfter' event field, but the UserProblem record has
no prHintsAfter accessor -- the field is showHintsAfter (used correctly
for the global problem in problem()). Generating a Caliper event for a
problem attempt would die with "Can't locate object method prHintsAfter".
Call showHintsAfter() instead.
@xcompass xcompass changed the title Fix misspelled Caliper::ResourceIri package and nonexistent prHintsAfter() call Fix Caliper::Entity calling nonexistent prHintsAfter() method Jul 11, 2026
@xcompass xcompass changed the base branch from develop to WeBWorK-2.21 July 11, 2026 16:36
@xcompass

Copy link
Copy Markdown
Member Author

Done — rebased onto WeBWorK-2.21, dropped the ResourceIri spelling commit (deferring to #3044), and retargeted the PR. It is now the single-line prHintsAfter()showHintsAfter() fix.

@drgrice1

Copy link
Copy Markdown
Member

If you review and approve pull request #3044, then we can merge that. Once this receives another approval it can be merged as well.

@Alex-Jordan Alex-Jordan merged commit 0d83b13 into openwebwork:WeBWorK-2.21 Jul 11, 2026
2 checks passed
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.

3 participants