Doctrine 1
  1. Doctrine 1
  2. DC-236

Doctrine_Collection->toHierarchy() : __children field doesn't contain correct children

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 1.2.0-BETA1, 1.2.0-BETA2
    • Fix Version/s: 1.2.0-BETA3
    • Component/s: Nested Set
    • Labels:
      None
    • Environment:
      PHP 5.2.9 on Windows Server 2003 with MySQL

      Description

      This bug was discovered while using getDescendants with the new toHierarchy function. Rather than containing the correct child elements in the __children field, it contains whatever the next record is. Each record only has a single child, which is the record with the next-highest lft value. You can see this in the following pastebin. Notice that the very bottom element is placed around level 15 in the tree, yet it should be level 4 according to the "level" field.

      The line that was used to produce the above pastebin was:
      print_r($children = $file->getNode()>getDescendants(null, false)>toHierarchy()->toArray());
      The class used for $file is: http://pastebin.ca/1673706

        Activity

        Hide
        Jonathan H. Wage added a comment -

        Thanks for reporting the issue, it is fixed now.

        Show
        Jonathan H. Wage added a comment - Thanks for reporting the issue, it is fixed now.

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            Nate
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: