Skip to content

48279 - Participants tab fails to render when the percentage column is enabled - #12029

Closed
lorenzgith wants to merge 1 commit into
ILIAS-eLearning:release_10from
lorenzgith:fix/48279-participants-null-percent
Closed

48279 - Participants tab fails to render when the percentage column is enabled#12029
lorenzgith wants to merge 1 commit into
ILIAS-eLearning:release_10from
lorenzgith:fix/48279-participants-null-percent

Conversation

@lorenzgith

Copy link
Copy Markdown
Contributor

https://mantis.ilias.de/view.php?id=48279

As soon as the optional column for the achieved percentage is switched on in the participants table of a test, the whole tab stops rendering:

number_format(): Argument #1 ($num) must be of type int|float, null given
in UI/src/Implementation/Component/Table/Column/Number.php:68

percent_of_available_points is a number() column, but the row value is built with the null-safe operator and no fallback, so a participant without an attempt yields null. The renderer then hands that null to number_format() and the whole table fails, not just the affected cell.

The neighbouring values in the same method all do provide a fallback (total_attempts ?? 0, test_passed ?? false, total_time_on_task ?? ''); only the percentage lacks one. This adds ?? 0 accordingly.

If an empty cell is preferred over a zero for participants without an attempt, letting the number column render null would be the alternative, but the fallback is the smaller and more consistent change.

@kergomard

Copy link
Copy Markdown
Contributor

Thank you very much for the PR @lorenzgith !

I picked your changes manually, as I wanted to have a value that was consistent with the return type of the function, but you are clearly still the author.

Best,
@kergomard

@kergomard kergomard closed this Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants