File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -592,10 +592,11 @@ public function import_categories(): void {
592
592
// Categories will be dealt with before their sub-categories. Beyond that,
593
593
// order is uncertain.
594
594
595
- if (!$ this ->subdirectory || $ this ->subdirectory === 'top ' ) {
595
+ if (!$ this ->subdirectory || $ this ->subdirectory === 'top ' || ! $ this -> targetcategory ) {
596
596
$ this ->basecategoryname = 'top ' ;
597
597
} else {
598
- $ this ->basecategoryname = null ;
598
+ $ this ->basecategoryname =
599
+ cli_helper::get_question_category_from_file ($ subdirectory . '/ ' . cli_helper::CATEGORY_FILE . '.xml ' );
599
600
}
600
601
foreach ($ this ->repoiterator as $ repoitem ) {
601
602
if ($ repoitem ->isFile ()) {
@@ -619,12 +620,9 @@ public function import_categories(): void {
619
620
}
620
621
}
621
622
if ($ this ->targetcategory ) {
622
- if (!$ this ->basecategoryname ) {
623
- // If target category is not top,
624
- // the first category file we encounter will be for the target category.
623
+ if (pathinfo ($ repoitem , PATHINFO_DIRNAME ) === $ subdirectory ) {
625
624
// This must already exist. (We've checked!).
626
- // Set base category name and skip upload.
627
- $ this ->basecategoryname = $ qcategoryname ;
625
+ // Skip upload.
628
626
continue ;
629
627
}
630
628
// Strip base name from category name and replace with target category.
You can’t perform that action at this time.
0 commit comments