Doctrine 1
  1. Doctrine 1
  2. DC-317

Using NestedSet behavior, createRoot function doesn't behave as expected with string multiple root key

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.0
    • Fix Version/s: 1.2.1
    • Component/s: Behaviors, Nested Set
    • Labels:
      None
    • Environment:
      Using Symfony 1.4 and MySQL

      Description

      I have defined this model :

       
      Page:
        options: { type: InnoDB, collate: utf8_unicode_ci, charset: utf8 }
        columns:
          topic:       { type: string(32), notnull: true }
          title:        { type: string(255), notnull: true }
        actAs:
          NestedSet:      { hasManyRoots: true, rootColumnName: topic }
      

      And use this code (database is empty) :

      <?
      
      $page = new Page;
      $page->topic = 'my-topic';
      $page->title = 'My Title';
      $page->save();
      
      print_r( $page->topic );  // OK, here it's perfect
      
      Doctrine::getTable('Page')->getTree()->createRoot( $page );
      
      print_r( $page->topic ); // Now topic == 1 . It's buggy !
      
      
      Doctrine::getTable('Page')->getTree()->fetchTree( 'my-topic' ); // Buggy : return false !
      
      ?>
      

      Let me know if you need more explainations,
      julien

        Activity

        There are no comments yet on this issue.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: