Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

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

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

Bug in DataObject


Go to End


3 Posts   1898 Views

Avatar
Markus

Google Summer of Code Hacker, 152 Posts

20 August 2007 at 10:07pm

Edited: 20/08/2007 10:08pm

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!

Avatar
Bernat

Google Summer of Code Hacker, 11 Posts

21 August 2007 at 10:06am

Hi Markus,

It seems that this is set at line 400:

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

Avatar
Markus

Google Summer of Code Hacker, 152 Posts

21 August 2007 at 8:01pm

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