I'm using a workaround as well.
Your code's performance can be improved. Instead of using
in_array
inside the for loop, use a keyed array. In addition, there can be more than onesid
field, so it might not be named that. In addition, you should update the row count.$combined = []; foreach ($view->result as $row) { /** @var \Drupal\webform\WebformSubmissionInterface $webform_submission */ $webform_submission = $row->_entity; if (!isset($combined[$webform_submission->id()])) { $combined[$webform_submission->id()] = $row; } } // Replace the result set with the combined result. $view->result = $combined; $view->total_rows = count($combined);
Hi @solideogloria, not sure why but your approach broke any views pages that used anything other than the 'Table' format, and broke the "Webform submission operations bulk form" checkboxes (they no longer appeared). I am not sure why (and don't currently have time to test) but I have reverted to my original approach and it continues to work.
- First commit to issue fork.