problem:
- base of problem is a views query, where node table is joined via left join to any other base table, whereas there might be result datasets, where there is no match for a node dataset -> node ID in final query result for this datasets is NULL

- in case of node ID is returned as "NULL" from DB, no change on variables for link-to-node generation is done in views_handler_field_node::render_link(). If there was correct link-to-node generation in previous data-row, handler options stay in place for the field rendering of the row, where NULL is delivered as "node ID".

- if view option "hide, if empty" is checked for the diplaying of the field "Node ID", this causes no problem since no output content is generated

- There is a problem, if you overwrite the content of field "Node ID" via token in views UI. In this case, there might be a field content (eg. from previous colums) despite there is a NULL value returned as node ID from views query. In current implementation, the link-to-node from previous data row is applied to this field content, leading faulty linking. For me it is appreciated that there is no link-to-node if it is NULL returned as node ID from DB and despite this fact there is a valid field content (eg. by token usage).

I added a patch, which fixed my problem.

Comments

dawehner’s picture

Status: Needs review » Needs work

Thats bad code style :)

But it should be fixable.

dawehner’s picture

Status: Needs work » Needs review
StatusFileSize
new794 bytes

Update codestyle

TS79’s picture

Status: Needs review » Reviewed & tested by the community

implementation works

merlinofchaos’s picture

Status: Reviewed & tested by the community » Fixed

Committed to all branches.

Status: Fixed » Closed (fixed)

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

quartsize’s picture

Status: Closed (fixed) » Needs work

I believe this causes a regression; it has disabled the use of "Output this field as a link" on fields that also have the option to "Link this field to its node" (e.g. "node: title"), since the else block inserted by this patch sets $this->options['alter']['make_link'] false before it is checked by views_handler_field::render_text().

Alas, I do not understand the original problem well enough to fix this patch.

dawehner’s picture

TS79’s picture

Status: Closed (won't fix) » Closed (fixed)