# Kategoriebaum per DAL

**URL:** <https://forum.shopware.com/t/kategoriebaum-per-dal/63361>\
**Category:** Programmierung\
**Created:** [5. Dezember 2019 um 09:40 UTC](https://forum.shopware.com/t/kategoriebaum-per-dal/63361 "2019-12-05T09:40:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![TeichDatensysteme](https://avatars.discourse-cdn.com/v4/letter/t/43a26b/32.png) [@TeichDatensysteme](https://forum.shopware.com/u/TeichDatensysteme)\
**Post date:** [5. Dezember 2019 um 09:40 UTC](https://forum.shopware.com/t/kategoriebaum-per-dal/63361/1 "2019-12-05T09:40:31Z")

</div>

Hallo!

Leider klappt mein Versuch nicht, einen (Unter)-Kategoriebaum via DAL zu erstellen:

```
[0]=>
  array(7) {
    ["id"]=>
    string(32) "36a825c660264204970689e3237184ad"
    ["parentId"]=>
    string(32) "2fcee001997745999d8268c93158bf54"
    ["active"]=>
    bool(true)
    ["displayNestedProducts"]=>
    bool(true)
    ["type"]=>
    string(8) "category"
    ["visible"]=>
    bool(true)
    ["translations"]=>
    array(1) {
      ["de-DE"]=>
      array(1) {
        ["name"]=>
        string(11) "example category"
      }
    }
  }
  [1]=>
  array(7) {
    ["id"]=>
    string(32) "a01089c57936418d9046814dfd57cf84"
    ["parentId"]=>
    string(32) "36a825c660264204970689e3237184ad"
    ["active"]=>
    bool(true)
    ["displayNestedProducts"]=>
    bool(true)
    ["type"]=>
    string(8) "category"
    ["visible"]=>
    bool(true)
    ["translations"]=>
    array(1) {
      ["de-DE"]=>
      array(1) {
        ["name"]=>
        string(14) "example sub category"
      }
    }
  }

```

Das scheppert.  
Soweit, dass ich jetzt im admin meine Kategorien nicht mehr sehe.  
Mit …

```
./bin/console dal:refresh:index

```

Kracht es ebenfalls:

```
In TreeIndexer.php line 285:
Argument 3 passed to Shopware\Core\Framework\DataAbstractionLayer\Indexing\Indexer\TreeIndexer::loadParents() must be of the type string, null given, called in /www/htdocs/... /.../vendor/shopware/core/Framework/DataAbstractionLayer/Indexing/Indexer/TreeIndexer.php on line 302

```

Irgendwelche Idee, wie ich a. Kategorien ordentlich speichern kann und b. den aktuellen Baum retten kann?  
Ein reindex nach einem Kategoriebaum-Update wäre bestimmt auch richtig.

Schöne Grüße,  
Niklas
