Unverified Commit 3d54914c authored by nwoodland's avatar nwoodland Committed by Tim Kruijsen

Issue #3009375 by nwoodland: Taxonomy with parent and child terms can lead to endless import loop

parent 3a60eb57
......@@ -151,6 +151,16 @@ class TaxonomiesController extends ControllerBase {
$taxonomies = $taxonomiesConfig;
}
// Sorts taxonomies so that all parent terms come before -- and therefore
// are created before -- their respective child terms
foreach ($taxonomies as $taxonomy => $terms) {
$parents = [];
foreach ($terms as $key => $term_data) {
$parents[$key] = $term_data['parent'];
}
array_multisort($parents, SORT_ASC, $taxonomies[$taxonomy]);
}
if (array_key_exists('drush', $form) && $form['drush'] === TRUE) {
$context = [];
$context['drush'] = TRUE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment