As the the view field is global, it may be added in all view area, like header, footer or empty text. In such cases, the arguments are not set correctly.

The patch below fixes that (in a proper but quick way, see below).

On the other hand, I think the view field handler should be different than the area handler. Like that the code could be simpler and edge cases handled more easily.
If you need some help on that, I would be glad to become a co-maintainer.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

B-Prod’s picture

Status: Active » Needs review
FileSize
1.73 KB

Patch attached

damiankloip’s picture

Is this with query aggregation on or off? Will have a look at the patch shortly!

damiankloip’s picture

Status: Needs review » Fixed

I have just committed a patch that should fix this. I don't think we need to create a mock view object. We can just populate the values object at the start of render if we need to.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

B-Prod’s picture

Priority: Normal » Critical
Status: Closed (fixed) » Needs work
FileSize
904 bytes

This is not fixed in the new version. I set this issue as critical because the bug becomes aged and is pretty simple to test and fix.

To reproduce such bug, just create a view (content) with 2 displays:

  • 1 display (table) that has a field [tid] that relates to a relationship to the main node (you may add some other fields like nid to have some data to display)
  • 1 display (HTML list) that has a [tid] context argument and display for example only the node titles

In the first display, create in the header or footer a views field that uses the second display and pass the [tid] as argument.

You expect to see a table, followed by an HTML list containing the node titles.

But you will only see the table, because there are no field handlers loaded to use with the tokens.

I saw fixed a part of the code in the previous patch, about empty values in areas. So the only issue to fix now is simply to ensure that the field handlers are loaded before trying to make the replacements.