fix for array value handling in sumRowArray() #14917
Closed
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.
Since some time the archive job crashes in my setup with
What I found out after some debuging:
The AbTesting plugin causes sumRowArray($thisColumnValue, $columnToSumValue) to be called
a) with a float value in $thisColumnValue and an array in $columnToSumValue
In this case the
if (!isset($newValue[$arrayIndex])) {
check is triggered, however, because $newValue is a float, PHP will not convert $newValue to an array, and the $newValue[$arrayIndex] will pass a value of "null" to the recursive sumRowArray() call. This will trigger the above exception.Because the documentation of sumRowArray() allows $columnToSumValue to be an array, this is most likely a bug.
b) with an array $thisColumnValue and a float value in $columnToSumValue
This case is not allowed by the function documentation, but maybe it makes sense to handle this case, too?
These changes should be reviewed with care, as I do not yet fully understand why the AbTesting plugin is causing these problems.