if ($file_entity = FileType::load($value)) {
      return $file_entity->label();
    }

FileType::load() gets you a file type entity, not a file entity.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

joachim created an issue. See original summary.

rashid_786’s picture

patch created with necessary changes.

Status: Needs review » Needs work

The last submitted patch, 2: file_entity-confusing-variable-name-2718173-2.patch, failed testing.

Berdir’s picture

Test fail is unrelated.

If we change it anyway, lets use just $file_type. the entity suffix is not necessary.

rashid_786’s picture

Status: Needs work » Needs review
FileSize
548 bytes

Changes made as suggested.

Status: Needs review » Needs work

The last submitted patch, 5: file_entity-confuse-variable-name-2718173-5.patch, failed testing.

The last submitted patch, 5: file_entity-confuse-variable-name-2718173-5.patch, failed testing.

Berdir’s picture

Status: Needs work » Reviewed & tested by the community

Thanks.

rashid_786’s picture