[mode] Mode format returns mode count, not the actual mode
#979 opened on Nov 15, 2025
Repository metrics
- Stars
- (52 stars)
- PR merge metrics
- (PR metrics pending)
Description
It seems that the mode format returns how many times the mode appears, not the actual mode itself
https://github.com/SemanticMediaWiki/SemanticResultFormats/blob/42c26905f5d9f25a321a0c3b286d5b0d239a8083/formats/math/SRF_Math.php#L187
https://github.com/SemanticMediaWiki/SemanticResultFormats/blob/42c26905f5d9f25a321a0c3b286d5b0d239a8083/formats/math/SRF_Math.php#L189
https://github.com/SemanticMediaWiki/SemanticResultFormats/blob/42c26905f5d9f25a321a0c3b286d5b0d239a8083/formats/math/SRF_Math.php#L201
array_count_values gives counts as values, and max gets the max value, meaning $max is a count, not the most common property value
It seems the unit test even expects the count instead of the actual mode
The mode should be 333, the only number, but instead it expects and gets how many times 333 occurs