Jump to:

4873 Posts in 7127 Topics by 1471 members

Installing SilverStripe

SilverStripe Forums » Installing SilverStripe » PostgreSQL bug in trunk

Getting SilverStripe up and running on your computer and on your web server.

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

Page: 1
Go to End
Author Topic: 637 Views
  • zmeuka
    Avatar
    Community Member
    3 Posts

    PostgreSQL bug in trunk Link to this post

    I have downloaded postgresql-trunk-r113659.tar.gz - but after fresh SilverStripe install the Admin interface was almost dead.
    The problem is under "todo" in PostgreSQLDatabase.php:

    Actual PG Constraint string:

    CHECK ("ClassName"::text = 'SiteTree'::text OR "ClassName"::text = 'Page'::text
    OR "ClassName"::text = 'ErrorPage'::text OR "ClassName"::text = 'RedirectorPage'::text
    OR "ClassName"::text = 'VirtualPage'::text)

    Code from trunk (as you can see there's no chances to get classes from constraint above):

    private function EnumValuesFromConstraint($constraint){
    $constraint=substr($constraint, strpos($constraint, 'ANY (ARRAY[')+11);
    $constraint=substr($constraint, 0, -11);
    $constraints=Array();
    $segments=explode(',', $constraint);
    foreach($segments as $this_segment){
    $bits=preg_split('/ *:: * /', $this_segment);
    array_unshift($constraints, trim($bits[0], " '"));
    }
    return $constraints;
    }

       

    My replacement - working - code:

    private function EnumValuesFromConstraint($constraint){
    $matches = Array();
    $constraints = Array();
    if (preg_match_all("/\'(\w+)\'\:\:text/",$constraint,$matches)) {
    $constraints = $matches[1];
    }
    return $constraints;
    }

  • Sean
    Avatar
    Forum Moderator
    921 Posts

    Re: PostgreSQL bug in trunk Link to this post

    Hi zmeuka,

    I couldn't replicate this. Where abouts were you having issues?

    I'm using PostgreSQL 8.3.12, SilverStripe 2.4 check out from http://svn.silverstripe.com/open/phpinstaller/branches/2.4 @ revision 113808 and postgresql module @ revision r113659.

    Sean

  • zmeuka
    Avatar
    Community Member
    3 Posts

    Re: PostgreSQL bug in trunk Link to this post

    SilverStripe 2.4.3 (stable download) and same PostgreSQL module from SVN.
    Admin Interface dies after fresh install with error about bad class name in singleton (singleton called with class name = 'ssName"').
    Maybe the constraint syntax in SS2.4/svn changed?

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