Download & Extend

PHP filter needs to reset array keys for rows

Project:Views PHP
Version:7.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:chasingmaxwell
Status:needs review

Issue Summary

When the Global PHP filter removes rows from the result array in php_post_execute() it does not reset the keys. So you end up with something like this:

[0] => 'Brian',
[5] => 'Lucy',
[6] => 'Joe',

because rows 1-4 were filtered out. This causes problems down the road when in views it tries to set the field_output by the row_index (see sites/all/modules/views/theme/theme.inc, line 186 in Views 7.x-3.3). It expects this:

[0] => 'Brian',
[1] => 'Lucy',
[2] => 'Joe',

Working on a patch now and will have it uploaded in a few minutes.

Comments

#1

Status:active» needs review
AttachmentSize
views_php-reset_row_keys-1602072-1.patch 468 bytes