Taxonomy hierarchy is exported, but not imported when I enable my custom module.
Steps to recreate:
- Create Taxonomy items with hierarchy
- List term uuid's in custom module's info.yml file
- Run
drush default-content-export-module {custom_module}
- Remove Taxonomy items
- Disable/enable {custom_module} (to import)
Here is an example taxonomy_term that I exported, which includes a parent relationship:
{
"_links": {
"self": {
"href": "http:\/\/default\/taxonomy\/term\/8?_format=hal_json"
},
"type": {
"href": "http:\/\/drupal.org\/rest\/type\/taxonomy_term\/category"
},
"http:\/\/drupal.org\/rest\/relation\/taxonomy_term\/category\/parent": [
{
"href": "http:\/\/default\/taxonomy\/term\/6?_format=hal_json"
}
]
},
"tid": [
{
"value": 8
}
],
"uuid": [
{
"value": "2d13ed7c-1cac-47e0-b941-e5f82801e800"
}
],
"revision_id": [
{
"value": 8
}
],
"langcode": [
{
"value": "en",
"lang": "en"
}
],
"vid": [
{
"target_id": "category"
}
],
"revision_created": [
{
"value": "2019-08-28T00:21:44+00:00",
"format": "Y-m-d\\TH:i:sP"
}
],
"status": [
{
"value": true,
"lang": "en"
}
],
"name": [
{
"value": "Getting a Loan",
"lang": "en"
}
],
"weight": [
{
"value": 0
}
],
"_embedded": {
"http:\/\/drupal.org\/rest\/relation\/taxonomy_term\/category\/parent": [
{
"_links": {
"self": {
"href": "http:\/\/default\/taxonomy\/term\/6?_format=hal_json"
},
"type": {
"href": "http:\/\/drupal.org\/rest\/type\/taxonomy_term\/category"
}
},
"uuid": [
{
"value": "fbcc34a3-26d0-4443-aaaf-b3e12e2b6699"
}
]
}
]
},
"changed": [
{
"value": "2019-09-09T16:13:36+00:00",
"lang": "en",
"format": "Y-m-d\\TH:i:sP"
}
],
"default_langcode": [
{
"value": true,
"lang": "en"
}
],
"revision_translation_affected": [
{
"value": true,
"lang": "en"
}
],
"path": [
{
"alias": null,
"pid": null,
"langcode": "en",
"lang": "en"
}
]
}
And here is the parent:
{
"_links": {
"self": {
"href": "http:\/\/default\/taxonomy\/term\/6?_format=hal_json"
},
"type": {
"href": "http:\/\/drupal.org\/rest\/type\/taxonomy_term\/category"
},
"http:\/\/drupal.org\/rest\/relation\/taxonomy_term\/category\/parent": [
null
]
},
"tid": [
{
"value": 6
}
],
"uuid": [
{
"value": "fbcc34a3-26d0-4443-aaaf-b3e12e2b6699"
}
],
"revision_id": [
{
"value": 6
}
],
"langcode": [
{
"value": "en",
"lang": "en"
}
],
"vid": [
{
"target_id": "category"
}
],
"revision_created": [
{
"value": "2019-08-28T00:21:22+00:00",
"format": "Y-m-d\\TH:i:sP"
}
],
"status": [
{
"value": true,
"lang": "en"
}
],
"name": [
{
"value": "Housing",
"lang": "en"
}
],
"weight": [
{
"value": 0
}
],
"_embedded": {
"http:\/\/drupal.org\/rest\/relation\/taxonomy_term\/category\/parent": [
null
]
},
"changed": [
{
"value": "2019-09-09T16:16:13+00:00",
"lang": "en",
"format": "Y-m-d\\TH:i:sP"
}
],
"default_langcode": [
{
"value": true,
"lang": "en"
}
],
"revision_translation_affected": [
{
"value": true,
"lang": "en"
}
],
"path": [
{
"alias": null,
"pid": null,
"langcode": "en",
"lang": "en"
}
]
}
Any idea why this is happening?
Also, I do see a similar issue: Taxonomy hierarchy is not exported (2687075) where a fix was already released. However, this does not seem to apply to my use case. Maybe because I am using dcem instead of dcer?
Comments
Comment #2
berdirI've recently created the 2.0.x branch, see the project page on all the improvements in the 2.0.x branch. Testing that and providing feedback would be very welcome. The 1.x branch isn't actively maintained and won't receive new features anymore, so I'm closing this and other issues as won't fix.
Term parent references should work fine both for 1.x and 2.0.x, but you're welcome to try 2.0.x