- Issue created by @ramlev
- πΊπΈUnited States tr Cascadia
Yes, the code appears to be wrong - adding the type case simply revealed the error. Can you post an export of a simple view that demonstrates the problem?
I have applied the changes according to the issue in Table.php file please review it.
- πΊπΈUnited States tr Cascadia
No, that doesn't fix the problem, it just avoids an error message.
We already haveif (isset($row_num)) { } else { }
And $row_num is allowed to be NULL. So if it needs to be used in the else clause, that's where the change should be made. Setting $row_num to 0 is a huge assumption.
But more importantly, we have to first identify why this is a problem. Is it only when the table has no content so there are no rows? That's why I asked for an export of a simple view that demonstrates this problem. That way we can have a test that shows the problem, proves that the fix works, and prevents the problem from happening again in the future.
- πΊπΈUnited States shamilto2000
I was also having this error, but I was able to fix it by changing a setting in my view.
The format of the view is Table with Aggregation Options. Previously under Group aggregation options, I had checked "no aggregation, results will be shown after each group (like subtotals)." I have changed this to "results will be aggregated with one row per group."
This is not ideal, as I would like to see the subtotals. Perhaps this can help you locate the source of the problem.
- π¬π§United Kingdom Krys15
I also had this error.
I was applying 2 aggregations the first to 'group and compress', the second 'maximum'. I removed the maximum aggregation, and my page is working again. I suspect the second aggregation is not performing any useful function, but I've not yet tested fully.
- π©π°Denmark ramlev
The patch does not resolve the issue.
The problem arises because the
$row_num
parameter in thesetCell
method is typecast as an integer. However, in several instances within the code, it is called with a NULL value. Additionally, the methodsrenderNewValue
andrenderNewWebformValue
both accept$row_num
as a parameter, but one method typecasts it while the other does not.
I believe the solution is to either remove the typecasting altogether, or it appears that the issue can be resolved by modifying thesetCell()
method as follows:From:
public function setCell(FieldHandlerInterface $field_handler, int$row_num, $new_values, string $separator) {
To:
public function setCell(FieldHandlerInterface $field_handler, int|null $row_num, $new_values, string $separator) {
- π©πͺGermany butch.coolidge Reutlingen
We were having the same error, Patch #10 works.
Thanks very much.