The relationship defined in flag_views_data_alter() uses the entity ID rather than the label.

Comments

joachim created an issue. See original summary.

dagmar’s picture

Status: Active » Needs review
StatusFileSize
new1.1 KB

Here is the patch.

joachim’s picture

Status: Needs review » Needs work

Thanks for the patch!

That's not quite what I meant, though, sorry -- it should be the *entity type* label instead of the entity type ID:

+++ b/flag.views.inc
@@ -63,7 +63,7 @@ function flag_views_data_alter(array &$data) {
-        'title' => t('@entity_label flag', ['@entity_label' => $entity_type_id]),
+        'title' => t('@entity_label flag', ['@entity_label' => $flag->label()]),
rashid_786’s picture

StatusFileSize
new778 bytes
new777 bytes

updated patch with suggested changes.

rashid_786’s picture

Status: Needs work » Needs review
joachim’s picture

Status: Needs review » Needs work

Hm that's not it either, I'm afraid.

$entity_type is an object, not a string. You want to call ->label() on it IIRC. Check the code elsewhere -- eg the 'add flag' admin -- for code that does the same thing to see what the right method is.

klidifia’s picture

Status: Needs work » Needs review
StatusFileSize
new787 bytes
new784 bytes

Calling ->label() on $entity_type

Status: Needs review » Needs work

The last submitted patch, 7: 2629174-views-relationship-label-7.patch, failed testing.

dagmar’s picture

Status: Needs work » Needs review
StatusFileSize
new790 bytes

Thanks @joachim.

Actually I think for Entity Types the right method is getLabel().

socketwench’s picture

Status: Needs review » Fixed

Thanks everyone!

  • dagmar authored 677a980 on
    Issue #2629174 by dagmar, rashid_786, klidifia: Fixed views relationship...

Status: Fixed » Closed (fixed)

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