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.
Problem/Motivation
When using devel generate on a content type that has a term reference field, it will reference any term, not just terms in the allowed vocabulary.
Steps to reproduce:
- Have a couple vocabularies.
- Create a content type with a term reference field, and allow terms from only one of those vocabularies in the field.
- Generate a bunch of nodes in that content type.
- See terms from other vocabularies displaying on the generated content.
Also worth noting:
If you edit one of the generated nodes and select allowed terms, the ones from non-referenced fields will be removed from the node when you save.
I'm on Mac OS X Yosemite, using MAMP and PHP 5.6.2. I've experienced this in Chrome, Safari and Firefox. Haven't tested elsewhere.
Comments
Comment #1
willzyx CreditAttribution: willzyx commented@rainbreaw thanks for reporting.
This issue doesn't seems to be related to devel since the creation logic for dummy terms is in core (see
\Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem::generateSampleValue()
).However, I did some testing and I was unable to replicate the fault; Are you using HEAD version of drupal and devel?
Comment #2
willzyx CreditAttribution: willzyx commentedComment #3
willzyx CreditAttribution: willzyx commentedClosing for lack of activity. Feel free to reopen if the issue still exists