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.

Archive /

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

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

Patch: Fix errors when running db/build

Go to End

2 Posts   1999 Views


Google Summer of Code Hacker, 222 Posts

24 May 2007 at 10:18am

Using the latest daily build, I get a bunch of error notices when I run db/build.
This patch fixes most of those errors:

Explanation of changes:

1. First off, this patch fixes this error:
Notice: Undefined index: LeftAndMain in /var/www/silverstripe/sapphire/core/Object.php on line 241

The fix was in addStaticVars() to only merge Object::$extraStatics[$class] with $statics if it is not empty.

2. Next, it fixes repeated errors like this:

Notice: Use of undefined constant Datetime - assumed 'Datetime' in /var/www/silverstripe/sapphire/core/model/Database.php(67) : eval()'d code on line 1

It does this by adding the needed single quotes around the first parameter in statements like:
return Object::create('Datetime',$fieldName);

3. It also fixes a bunch of errors like this by just changing $field to $fieldName:

Notice: Undefined variable: field in /var/www/silverstripe/sapphire/core/model/DataObject.php on line 955

4. This patch does not fix the following error:
Notice: Undefined variable: surl in /var/www/silverstripe/sapphire/main.php on line 109

A fix for that error was posted by steki here:

Hope this helps,



Community Member, 231 Posts

28 May 2007 at 2:26pm

Excellent, applied.