If select format "Title of parent entity", and parent entity is media then return error "InvalidArgumentException: Field title is unknown."

Comments

trishen created an issue. See original summary.

  • New Zeal committed fa0165b on 8.x-1.x
    Issue #2894164: Support media entity
    
NewZeal’s picture

I've made it so that the error does not occur and when there is no title, the 'title' becomes the file name with a message to change the settings if that is not suitable. This is pushed to dev and will be released soon with the next release.

adinac’s picture

I've created a patch that uses the label() method to get the entity title.

NewZeal’s picture

Will that method work for all entities though?

seanb’s picture

The label() method is on \Drupal\Core\Entity\EntityInterface, so yes, that works for all entities.

I think #4 is good. One thing to check before RTBC though. The name/title/label of an entity is required in the UI, but could be an empty value when an entity is created programmatically. Is this something that should be handled?

  • New Zeal committed 6a4281e on 8.x-1.x authored by adinac
    Issue #2894164 by adinac: Support media entity
    
NewZeal’s picture

Status: Needs work » Needs review

Patch committed and push to dev branch. Please test.

NewZeal’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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