Now handling sub-cats with bad parent data - making top level cats
authorChuck Scott <cscott@gaslightmedia.com>
Tue, 26 Jan 2016 17:41:57 +0000 (12:41 -0500)
committerChuck Scott <cscott@gaslightmedia.com>
Tue, 26 Jan 2016 17:41:57 +0000 (12:41 -0500)
models/admin/management/import.php

index b8dcc7d..20f15ab 100644 (file)
@@ -437,9 +437,9 @@ class GlmMembersAdmin_management_import
                                     if (isset($category[$x['parent_id']])) {
                                         $category[$x['parent_id']]['subcat'][$x['category_id']] = $x;
                                     } else {
-                                        $templateData['genError']  = 'There is at least one sub-category that does not have a matching top-level parent! ('.$x['name'].')<br>
-                                                This could be a third-level category. Perhaps we can handle this when we have time to work on this a bit.';
-                                        $failure = true;
+                                        // Since the parent doesn't exist, we're just going to make this one a parent.
+                                        $category[$x['category_id']] = $x;
+                                        $category[$x['category_id']]['subcat'] = array();
                                     }
                                 }
                             }