Especially when using entityreference, allowing other modules to alter the list of renderable properties would be really useful. Currently the entityreference plugin only "knows about" three core entites: Node, User, Taxonomy term. So when referencing other entity types,
the developer has no mechanism to define which properties can be rendered.

I propose the introduction of a new alter hook: hook_reference_table_formatter_renderable_properties_alter().

Patch attached.

Comments

paranojik created an issue. See original summary.

sam152’s picture

Status: Needs review » Needs work

Not a bad idea, but people would still need to know about the hook and fix it. Would you rather submit a patch for the entities you are using? That way if anyone else is using those entity types, they can also benefit?

paranojik’s picture

StatusFileSize
new967 bytes

I've implemented a bunch of custom entities. Adding support for them wouldn't make much sense. Users can define their own entities with the ECK module. That's what I was refering to in the above proposal.

Anyway,...the first patch caused a PHP notice. This one fixes that.

paranojik’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 3: 2593267-renderable_properties_alter-3.patch, failed testing.

sam152’s picture

Status: Needs work » Fixed

These fails are in HEAD + field collection, not this patch. Thanks for your contribution.

Status: Fixed » Closed (fixed)

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