Hi to all
I have been experiencing weird behaviour on my server (and oddly not locally) when running dev/build.
The server is running a few Silvertripe websites perfectly so I don't think it's a php configuration problem.
Instead of printing out the usual grey screen with "Creating database tables" and "Creating database records" the browser download popup appears, asking me if I want to download the nonsense file build.php, which is empty of course.
Instead, when running dev/build/ (notice the added slash at the end) the build starts, but does not perform the "Creating database records" task.
This behaviour seems to be linked to three code files. I guess it has somthing to do with database relations. I try to reproduce them here without having to explain the whole context of this big project i'm working on, it would take too much time and space.
class ResearchFieldsContainer extends Page {
public static $db = array(
);
public static $has_one = array(
);
static $has_many = array(
'ResearchFields' =>'ResearchFields'
);
class ResearchFields extends DataObject {
static $db = array(
'Name' => "varchar(200)",
'Source' => "Enum('fromTechSpec,fromDescriptionPage')",
'NameOfFieldOfDescriptionPage' => "varchar(200)",
'Code' => "varchar(30)"
);
static $has_one = array(
"TechSpec" => "TechSpec",
"ResearchFieldsContainer" => "ResearchFieldsContainer"
);
TechSpec is another DataObject who gets related to other pages in my system, it's an old file that has always worked. Anyway...
class TechSpec extends DataObject {
static $db = array(
'Code' => 'varchar(30)',
'Description' => 'varchar(400)',
'Measure' => 'varchar(20)',
'EditChoice' => "Enum('free_text,Predefined_values')"
);
static $has_one = array(
'TechSpecPage' => 'TechSpecPage',
'Image' => 'Image'
);
static $has_many = array(
'TechSpecPredefinedValue' => 'TechSpecPredefinedValue',
'ResearchFields' => 'ResearchFields'
);
class TechSpecPredefinedValue extends DataObject {
static $db = array(
'Value' => 'varchar(255)'
);
static $has_one = array(
'TechSpec' => 'TechSpec'
);
Removing files ResearchFields and ResearchFieldsContainer solves the problem. But of course i need them and i need this relation model. HELP, Please!