Not sure why this is not failing any tests?

CommentFileSizeAuthor
#1 der-is-applicable-2403625-1.patch970 bytesberdir

Comments

berdir’s picture

Status: Active » Needs review
StatusFileSize
new970 bytes
jibran’s picture

Not sure why this is not failing any tests?

We don't have any tests for formatters right now.

+++ b/src/Plugin/Field/FieldFormatter/DynamicEntityReferenceEntityFormatter.php
@@ -24,4 +25,11 @@ use Drupal\entity_reference\Plugin\Field\FieldFormatter\EntityReferenceEntityFor
+    return TRUE;

So why always true?
Can't we do something like \Drupal::entityManager()->getDefinition($target_type)->hasViewBuilderClass(); here?

berdir’s picture

What $target_type?

I guess we could loop over all enabled entity types and return TRUE. or all of them?

jibran’s picture

I guess we could loop over all enabled entity types and return TRUE. or all of them?

Well in this return TRUE make sense
Perhaps in #2377841: Allow user to chose per entity type formatter. we can change that.

  • jibran committed f124248 on 8.x-1.x authored by Berdir
    Issue #2403625 by Berdir: isApplicable() on formatter is not overridden...
jibran’s picture

Status: Needs review » Fixed

Thank you for th bug report and patch committed and pushed.

jibran’s picture

Added major task #2405013: Add tests for all the formatters for formatter tests.

Status: Fixed » Closed (fixed)

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