Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
the attached patch adds a read-only "parents_all" property for taxonomy terms
Comment | File | Size | Author |
---|---|---|---|
#6 | entity_computed.patch | 7.47 KB | fago |
entity_taxonomy_parents_all.patch | 1.18 KB | dasjo | |
Comments
Comment #1
fagoPatch looks good and is certainly useful in conjunction with Rules or Search API. However, entity-property-info is supposed to denote properties of the entity, not any computed properties...
Still, we already have some computed properties like stuff that has been converted from tokens like node:edit_url or comment-count for a node. We also have some reverse-relationship properties that do not really exist directly on the entity.
However, the patch takes that this further. Going that way we might end up defining all data we have about an entity as entity-properties, which is certainly performance relevant for modules like rest_ws that just want to take *all* entity properties.
So meet both requirements, perhaps we should just denote that some properties are computed by using a 'computed' => TRUE key? So modules like rest-ws could choose (or implement an option) to hide/show computed properties too.
Comment #2
klausiInteresting. One could argue that the term parents are not properties of a term (strictly speaking), but I don't see any drawbacks here.
Comment #3
fagoSetting to needs-work until we've solved that issue.
Comment #4
fagoWe should figure out how to deal with computed stuff before the release.
Comment #5
klausiI agree with the suggestion from #1 to introduce a "computed" key (defaulting to FALSE) to indicate such virtual properties. This should help generic entity export modules like RESTWS to detect them and to ignore them.
Comment #6
fagook, attached patch does so. Also fixed the parents-all property. Please review.
Comment #7
fagoCommitted.