4579 Posts in 1388 Topics by 1378 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 535 Views |
-
PostgreSQL bug in trunk

16 November 2010 at 4:55pm
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;
} -
Re: PostgreSQL bug in trunk

16 November 2010 at 7:37pm
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
-
Re: PostgreSQL bug in trunk

16 November 2010 at 10:55pm Last edited: 16 November 2010 10:56pm
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?
| 535 Views | ||
|
Page:
1
|
Go to Top |


