backdrop-contrib / entity_plus

This module wraps in a variety of additional entity-related functionality from various sources. Partial port of D7 Entity API.
https://backdropcms.org/project/entity_plus
GNU General Public License v2.0
3 stars 11 forks source link

Taxonomy wrapper code and vocabulary code need cleanup #96

Closed argiepiano closed 2 years ago

argiepiano commented 2 years ago

Since Backdrop's taxonomy vocabularies are not entities anymore (see https://github.com/backdrop/backdrop/pull/520), the wrapper code for vocabularies needs to be updated. The fact that they are not entities makes it more difficult.

This is related to #71 . PR coming

argiepiano commented 2 years ago

PR #97

@laryn let me know if you want to take a look at these changes before I merge. To test, you can create a metadata wrapper of a taxonomy term and then access the vocabulary properties (like machine_name or description) through the chained properties, as in $term_wrapper->vocabulary->description->value().

You can also create a wrapper of a post node that has values in the Tags field, and then explore the vocabulary with $node_wrapper->field_tags[0]->vocabulary->name->value() and so forth.

Before these fixes it was impossible to access vocabulary values. This PR also takes care of the vid instances as outlined in #71 .

laryn commented 2 years ago

@argiepiano No, if you've tested thoroughly and feel good I say merge away. This is great -- thanks so much for all the improvements and fixes you're creating!