21283 Posts in 5730 Topics by 2602 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 223 Views |
-
Job Portal from book not working in SS 3.0.3

2 January 2013 at 11:58am
I am using SS 3.0.3 on Ubuntu with Apache2 and Php 5.3
I only copied the Job php files from the Wiley site:
http://au.wiley.com/WileyCDA/WileyTitle/productCd-0470681837,descCd-DOWNLOAD.html
Job.php
JobCategory.php
JobCategoryHolder.phpto:
mysite/code
and the ss files to:
JobCategory.ss
JobCategoryHolder.ss
JobCategory_showjob.ssthemes/simple/templates/Layout
Then ran the dev/build
index.php/dev/build
and it worked without any errors, created the tables etc.
I created a main Job page and assign it a "Job Category Overview" type and that worked.
I created 2 pages under the Job page and tried assigning them with the "Job Category" type but it just returns a blank page after I click on Save and Publish. From that point on, non of the Admin menu works and all returning blank page. If I refresh the admin page everything returns to normal but the sub pages have not been assigned the new type.
No errors in the Apache2 logs.
Any idea what is going on?
-
Re: Job Portal from book not working in SS 3.0.3

2 January 2013 at 3:20pm
I re-installed SS3, just in case it was screwed up, took the Job files from the book, modified them to fit my needs and the error I get is the following:
Error at line 1043 of SS3/framework/model/DataObject.php
after I do a dev/build (no errors) and try to assign a new type to a page.
Attached are the 3 php files I am using (had to rename to .txt for the upload to work).
Any idea?
-
Re: Job Portal from book not working in SS 3.0.3

2 January 2013 at 3:52pm
Doing the 3.0 tutorial here:
http://doc.silverstripe.org/framework/en/tutorials/5-dataobject-relationship-management
I get the same error as above:
Error at line 1043 of SS3/framework/model/DataObject.php
when I try to assign a Project type to a page.
Is there a bug in SS3 or am I doing it wrong?
-
Re: Job Portal from book not working in SS 3.0.3

8 January 2013 at 5:23pm
There is a lot of legacy code in that if you're working in 3. Try updating the reuests and replacing the ComplexTable field with a GridField to start. Also put the site into devmode to get better error reporting. I suspect in the backend the ComplexTable field ma be a problem but ActiveTenders function should be updated to a SS3 compatible query. Now I'm not sure if you can query for nulls and functions with a raw SQL where() in SS3 but you could request the whoel DataList and filter it like
public function ActiveTenders() {
$ActiveTenders = new ArrayList();
foreach($this->Tenders() as $tender) {
if(is_null($tender->ExpiryDate) || strtotime($tender->ExpiryDate) > time()) {
$ActiveTenders->push($tender);
}
}
return $ActiveTenders;
}I find some simple operations more complex with the new ORM, but the flexabilty and chainability is worth it.
http://doc.silverstripe.org/framework/en/topics/datamodelAs for the GridField
$tenderManagerConfig = GridFieldConfig_RelationEditor::create();
$tenderManagerConfig->addComponents(
new GridFieldDetailForm('Tender')
);
$tenderManager = new GridField(
"Tenders", "Tenders",
$this->Tenders(),
$tenderManagerConfig
);
$fields->addFieldToTab('Root.Main', $tenderManager);
| 223 Views | ||
|
Page:
1
|
Go to Top |


