I've read about how to prepopulate the taxonomy field here: https://www.drupal.org/node/228167
On a clean Drupal 7 install (Drupal 7.31) I've installed Prepopulate 7.x-2.0.
Prepopulating the title field works as expected, but I have no luck with taxonomy.
I've verified that there exists a taxonomy vocabulary (named Tags) with a vid=1 in {taxonomy_vocabulary} and that there is a term with the tid=1 in {taxonomy_term_data}.
However, the following URL does not prepopulate the tags taxonomy field:
http://www.example.com/node/add/article?edit[taxonomy][1]=1
There no error message, the taxonomy field ("Tags") is just not prepopulated.
Can anyone show an example URL that works?
Comments
Comment #1
Encarte commentedI think your solution is in #883980-19: New field formats are necessary in Prepopulate 6.x-2.x.
Comment #2
gisle@Encarte - did you test the syntax suggested in the comment you linked on a clean Drupal 7 install?
I've a taxonomy named "tags".
The following URL does not prepopulate the tags taxonomy field:
http://www.example.com/node/add/page?edit[taxonomy][tags][1]=testThere no error message, the taxonomy field ("Tags") is just not prepopulated.
Can anyone show an example URL that works?
Comment #3
mk1000 commentedThis works for me with taxonomy reference field:
Taxonomy fields with widget type taxonomy autocomplete and termname:
http://www.example.com/node/add/node?edit[field_ch_projekt][und]=termname
Taxonomy fields with widget type select list and term ID:
http://www.example.com/node/add/node?edit[field_ch_projekt_2][und]=92
Taxonomy fields with radios and term ID:
http://www.example.com/node/add/node?edit[field_ch_projekt][und][92]=92
Taxonomy fields with checkbox and term name or term ID
http://www.example.com/node/add/node?edit[field_ch_projekt][und][92]=92
http://www.example.com/node/add/node?edit[field_ch_projekt][und][92]=ter...
with multiple term IDs
http://www.example.com/node/add/node??edit[field_ch_projekt][und][92]=92...
Comment #4
joetsuihk commentedThanks @mk1000!
I have added your instructions to https://www.drupal.org/node/228167/revisions/view/7786483/7968191, proper credits in log message.
I think this is close case.
Comment #5
Tharick commented#3 works well, thanks for the effort :)
Comment #6
robertgarrigos commentedTaxonomy reference fields doesn't seem to work with 7.x-2.1
Comment #7
Pimmy commentedI actually with 7.x-2.1 I cannot prepopulate any filed apart from the title. For example:
Standard text field:
Node reference:
Comment #8
robertgarrigos commentedPimmy, for the node reference try:
http://<site>/node/add/<content_type>?field_project=75It seems this is working this way now for node reference.Comment #9
Pimmy commentedThanks Robert, but unfortunately it made no difference. I have also tried many other combinations with no success.
Comment #10
robertgarrigos commentedSorry Pimmy. I think that works because I also have the Entity Reference Prepopulate and the Entity Reference Prepopulate Token modules installed. You might give them a try.
Comment #11
clemens.tolboomLet's not distract the developer from #2679839: Container elements and their children cannot be prepopulated in the 7.x-2.1 security update release which blocks lot's of fields from getting pre-populated using 7.x-2.1
@robertgarrigos re-opening an old issue is not 'the right way' as it mostly distract developer.
Comment #12
Pimmy commentedI am sorry, but I gave up - Entity Reference might be pre-populating OK, but Node Reference pre-populating isnt working at all for me.
Ended up falling to the Node Reference URL Widget module and it works very nice and straight forward.
Comment #13
robertgarrigos commented@clemens.tolboom I agree. I wasn't aware of that issue.
Comment #14
anybody#11 is correct. I just checked the implementation and that's the reason. #2679839: Container elements and their children cannot be prepopulated in the 7.x-2.1 security update release is the problem behind.
Comment #15
ibraaheem commentedI can confirm that this works - &edit[field_name][und][tid]=tid
According to this issue
https://www.drupal.org/project/prepopulate/issues/1772148