cubicweb #3379407 The 'filter' kwarg does not always work correctly on pvdc [open]

More specifically, if we do (as documented

_pvs.tag_object_of(('*', 'my_relation', 'MyObject'), 'relations')
def get_particular_subjects(rset):
    return rset.filtered_rset(lambda x: x.__regid__ == 'MyParticularSubject')
_pvdc.tag_object_of(('*', 'my_relation', 'MyObject'),
                    {'label': _('My particular subject label'), 'vid': 'list',
                     'filter': get_particular_subjects})

we are not able to see the MyParticularSubject entities when invoking the primary view on a MyObject.

In our schema, MyParticularSubject is one of the etypes related to MyObject via the my_relation relation, such that we have

MyParticularSubject my_relation MyObject.

When using the default vid, we obtain the same effect. However, when using the 'table' view, a traceback is obtained (my_cube is the cube where the default primary view is defined):

2013-12-16 15:50:29 - (cubicweb.web) ERROR: IndexError('list index out of range',)
Traceback (most recent call last):
  File "/home/user/src/cubicweb/web/", line 456, in core_handle
    result = controller.publish(rset=rset)
  File "/home/user/src/cubicweb/web/views/", line 136, in publish
    rset=rset, view=view)
  File "/home/user/src/cubicweb/", line 398, in main_template
    res = obj.render(**kwargs)
  File "/home/user/src/cubicweb/", line 137, in render
  File "/home/user/src/cubes/my_cube/views/", line 46, in call
  File "/home/user/src/cubicweb/", line 137, in render
  File "/home/user/src/cubicweb/", line 348, in call
    super(EntityView, self).call(**kwargs)
  File "/home/user/src/cubicweb/", line 187, in call
    self.cell_call(row=0, **kwargs)
  File "/home/user/src/cubicweb/", line 351, in cell_call
    self.entity_call(self.cw_rset.get_entity(row, col), **kwargs)
  File "/home/user/src/cubicweb/web/views/", line 121, in entity_call
 File "/home/user/src/cubes/my_cube/views/", line 85, in render_entity
 File "/home/user/src/cubicweb/web/views/", line 268, in render_entity_relations
   value = rview.render()
 File "/home/user/src/cubicweb/", line 137, in render
 File "/home/user/src/cubicweb/web/views/", line 624, in call
 File "/home/user/src/cubicweb/web/", line 276, in layout_render
 File "/home/user/src/cubicweb/web/views/", line 209, in render
   self.render_table(w, actions, self.view.paginable)
 File "/home/user/src/cubicweb/web/views/", line 245, in render_table
   colrenderers = view.build_column_renderers()
 File "/home/user/src/cubicweb/web/views/", line 655, in build_column_renderers
   main_var_index = self.main_var_index()
 File "/home/user/src/cubicweb/web/views/", line 631, in main_var_index
   for i, etype in enumerate(self.cw_rset.description[0]):
IndexError: list index out of range

If we don't use the 'filter' kwarg, everything seems to work as expected, hence we obtain MyParticularSubject and other entities related to MyObject via the my_relation relation.

done in<not specified>
closed by<not specified>