Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Patch: Fix errors when running db/build

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: 1630 Views
  • elijahlofgren
    Avatar
    Google Summer of Code Hacker
    222 Posts

    Patch: Fix errors when running db/build Link to this post

    Using the latest daily build, I get a bunch of error notices when I run db/build.
    This patch fixes most of those errors:
    http://www.elijahlofgren.com/silverstripe/patches/Fix-db-build-errors-silverstripe.2.0.DailyBuild.2007-05-23.patch

    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: http://www.silverstripe.com/contributions/flat/1204

    Hope this helps,

    Elijah

  • Andy
    Avatar
    230 Posts

    Re: Patch: Fix errors when running db/build Link to this post

    Excellent, applied.

    1630 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.