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.
When using devel generate for Nodes with Taxonomy fields, the taxonomy terms are not so random.
See:
- Patch: Fixing fact that certain tax terms are nearly always selected by devel_generate
- Taxonomy terms aren't randomised when generating nodes with devel_generate
Opening this new ticket here, because the others are marked als closed/fixed/duplicated.
But this is not solved in devel_generate 7.x yet.
The patches in the above issues did not apply cleanly.
Comment | File | Size | Author |
---|---|---|---|
#4 | devel-generate--random-taxonomy-terms-on-generation.patch | 3.27 KB | lukas_w |
| |||
#2 | devel--random-terms-on-node-generation--2821116--02.patch | 1.36 KB | ndf |
|
Comments
Comment #2
ndf CreditAttribution: ndf at Dx Experts commentedHere a simple approach.
I noticed this can give duplicated results for multi-value fields.
Comment #3
ndf CreditAttribution: ndf at Dx Experts commentedComment #4
lukas_w CreditAttribution: lukas_w commentedSince I just had to get around this issue, here is another approach.
This one prevents duplicates in multi-value fields and also selects terms from all allowed vocabularies, if the field can contain terms from more than one vocabulary.