Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Bug in DataObject

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Page: 1
Go to End
Author Topic: 1327 Views
  • Markus
    Avatar
    Google Summer of Code Hacker
    152 Posts

    Bug in DataObject Link to this post

    Hi,

    there is a bug in DataObject::write():

    // New records have their insert into the base data table done
    // first, so that they can pass the generated primary key on
    // to the rest of the manipulation

    line 419: $baseTable = $ancestry[0];

    $ancestry is not set anywhere in the method!

  • Bernat
    Avatar
    Google Summer of Code Hacker
    11 Posts

    Re: Bug in DataObject Link to this post

    Hi Markus,

    It seems that this is set at line 400:

          foreach($this->getClassAncestry() as $ancestor) {
             if(ClassInfo::hasTable($ancestor)) $ancestry[] = $ancestor;
          }

  • Markus
    Avatar
    Google Summer of Code Hacker
    152 Posts

    Re: Bug in DataObject Link to this post

    Ahh right! I added the needed checks for that variable (r40621).

    1327 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.