Doctrine 1
  1. Doctrine 1
  2. DC-580

if deleting root with Doctrine_Node_NestedSet::delete() deletes all root nodes

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.1
    • Fix Version/s: 1.2.1
    • Component/s: Nested Set
    • Labels:
      None

      Description

      Im using next code
      $category = Doctrine_Core::getTable('Mr_DirectoryTreeNodes')->findOneBy('id',$params['id']);
      $node = $category->getNode();
      $node->delete();

      Doctrine_Node_NestedSet::delete() deletes all root nodes;
      _____________________

      to fix add

      $q = $q->addWhere("$baseAlias.id = ?", $this->record->get('id'));

      after :

      $q = $q->addWhere("$baseAlias.lft >= ? AND $baseAlias.rgt <= ?", array($this->getLeftValue(), $this->getRightValue()));

        Activity

        Hide
        Michael added a comment -

        with

        public function setUp()

        { $options = array( 'hasManyRoots' => true, 'rootColumnName' => 'root_id' ); $this->actAs('Timestampable'); $this->actAs('NestedSet',$options); parent::setUp(); }

        );

        it works propertly

        Show
        Michael added a comment - with public function setUp() { $options = array( 'hasManyRoots' => true, 'rootColumnName' => 'root_id' ); $this->actAs('Timestampable'); $this->actAs('NestedSet',$options); parent::setUp(); } ); it works propertly

          People

          • Assignee:
            Roman S. Borschel
            Reporter:
            Michael
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: