If the taxonomy term edit link is used via a relationship which can return empty values in some rows, a broken link is output.

Comments

joachim’s picture

Status: Active » Needs review
StatusFileSize
new1.87 KB

Here's a patch.

dawehner’s picture

Status: Needs review » Needs work
+++ b/modules/taxonomy/views_handler_field_term_link_edit.incundefined
@@ -39,16 +39,19 @@ class views_handler_field_term_link_edit extends views_handler_field {
+      $term->vid = $values->{$this->aliases['vid']};
+      $term->vocabulary_machine_name = $values->{$this->aliases['vocabulary_machine_name']};

What about converting this to $this->get_value() at the same time?

+++ b/modules/taxonomy/views_handler_field_term_link_edit.incundefined
@@ -39,16 +39,19 @@ class views_handler_field_term_link_edit extends views_handler_field {
+        $tid = $this->get_value($values, 'tid');

Why not simply drop this line, it is one less function call per row.

joachim’s picture

> What about converting this to $this->get_value() at the same time?

Won't that kill kittens? ;)

dawehner’s picture

Version: 7.x-3.x-dev » 8.x-3.x-dev
Status: Needs work » Patch (to be ported)

let's not waste time for that.

damiankloip’s picture

Status: Patch (to be ported) » Needs review
StatusFileSize
new1.82 KB

Here is a version for 8.x. I have removed the $tid = $this->get_value($values, 'tid') line from inside the conditional too as we are getting it twice?

So we might also need to then backport that change to 7.x ;)

dawehner’s picture

Version: 8.x-3.x-dev » 7.x-3.x-dev
Status: Needs review » Patch (to be ported)
Issue tags: +Novice

We could but i'm not sure whether it's worth for the time. Maybe a good task for a starter.

In general this will look totally different in d8, as this will depend on entities.

cck’s picture

Hi, I see the fix in patch #1 is already in 7.x-3.x. This task can be closed.