Details
-
Type:
Bug
-
Status:
Reopened
-
Priority:
Critical
-
Resolution: Unresolved
-
Affects Version/s: 1.2.0
-
Fix Version/s: None
-
Component/s: Nested Set
-
Labels:None
Description
DB schema:
Category:
actAs:
NestedSet:
hasManyRoots: true
rootColumnName: root_id
columns:
id:
type: integer(4)
primary: true
autoincrement: true
name:
type: string(64)
notnull: true
image: string(64)
indexes:
tree:
fields: [lft, rgt, root_id]
Sample data:
id: '1'
name: 'Przykładowa kategoria 1'
image: null
root_id: '1'
lft: '1'
rgt: '6'
level: '0'
id: '2'
name: 'Przykładowa kategoria 2'
image: null
root_id: '2'
lft: '1'
rgt: '6'
level: '0'
-
id: '3'
name: 'Przykładowa podkategoria 1'
image: null
root_id: '2'
lft: '2'
rgt: '5'
level: '1'
-
id: '4'
name: 'Przykładowa podkategoria 2'
image: null
root_id: '2'
lft: '3'
rgt: '4'
level: '2'
-
id: '5'
name: teset1
image: null
root_id: '1'
lft: '2'
rgt: '5'
level: '1'
-
id: '6'
name: test2
image: null
root_id: '1'
lft: '3'
rgt: '4'
level: '2'
When using HYDRATE_RECORD_HIERARCHY, the first top-level category is empty. Everything is assigned to the other one. Only single-root trees work properly.
A Doctrine_Collection with root nodes seems to work fine. It allows to traverse the tree for each root.