The Entity Reference field is a general purpose field for referencing entities (including taxonomy terms). It would be great if the Active Tags widget could be used for entity reference fields configured for taxonomies.

CommentFileSizeAuthor
#1 active_tags.entityreference.patch4.08 KBbgilhome

Comments

bgilhome’s picture

StatusFileSize
new4.08 KB

Here's a patch to add entityreference support for Active Tags. It requires the 'create new terms' patch to entityreference from https://drupal.org/node/1472596#comment-7670605.

In entityreference autocompletes, the id appears in brackets after the matched tag, however this is not saved to the term name. The id can be hidden with https://drupal.org/node/1802916#comment-6945660 or https://drupal.org/project/chosen_ajax.

bgilhome’s picture

PS ignore comment in active_tags_taxonomy_autocomplete_validate.

bgilhome’s picture

Status: Active » Needs review
jienckebd’s picture

@bgilhome

Thanks for the great patch!! #1 worked for me.

jienckebd’s picture

Also, #14 at https://drupal.org/node/1472596 is the patch to use in combination with this.

zilla’s picture

RTBC and ready for release into the dev version?

zilla’s picture

confused - @bgilhome: why does it require the 'create new terms' patch to entity reference if we only wish to use it to reference existing terms (and not allow for creation of new terms).

is that other patch optional when applying this patch?

bgilhome’s picture

Sorry, I should have made it optional - I was using the 'add new terms' patch for a project at the time and patched on top of that. The above patch applies OK without the 'add new terms' patch, but I haven't tested the functionality, I imagine it should be OK.

FYI, for the add new terms patch, subsequent to #14 on https://drupal.org/node/1472596 there have been better patches submitted - around #28.

zilla’s picture

thanks - i was actually going to mention that entity connect module is the more 'drupal and entity' way to manage creating a new entity from an entity reference field (versus what looks like a deprecated patch above)

zilla’s picture

any thoughts from the module maintainers on this patch and whether or not it belongs in the next release of the module (or in future releases in general)?

mahyarsbt’s picture

Assigned: Unassigned » mahyarsbt
Issue summary: View changes
Status: Needs review » Fixed

Thank you for your continued interest in the Active Tags module.

We are excited to announce that the issue you raised has been addressed in the revitalized Active Tags version 1.0.0. This update supports Drupal 9, 10, and 11 and brings a modern interface along with a range of new features to enhance your Drupal tagging experience, including:

  • Enhanced Tag Styling: Enjoy a modern and visually appealing interface for entity reference fields.
  • Dynamic Tag Creation: Flexibly enable or disable tag creation based on your Drupal settings.
  • Support for User Avatars: Display user avatars in tags when using the User entity autocomplete.
  • Efficient Tag Management: Organize tags effortlessly with drag-and-sort functionality, duplicate protection, and multiple selection support.
  • Entity ID Display: Optionally display the entity ID alongside each tag for added clarity.
  • Integration with Key Modules: Seamlessly integrate with Token, Webform, Facets, and Better Exposed Filters for enhanced filtering and autocomplete functionality.

This is just a glimpse of the new capabilities. We encourage you to explore these new features by downloading the latest version. For a full list of features and more details, please visit the Active Tags project page.

mahyarsbt’s picture

Status: Fixed » Closed (fixed)

With the release of Active Tags 1.0.0, we believe this issue has been fully resolved. We invite you to explore the latest version and share any feedback you have.

Thank you for your continued support and contributions to the Drupal community. Together, we can keep improving Active Tags!


Visit the Active Tags project page to stay updated and provide feedback.