7939 Posts in 1472 Topics by 944 members
|Go to End||Next >|
20 August 2010 at 3:34am Last edited: 20 August 2010 3:34am
I have coded the Video page and built the database with success.
I can create a Video Page and attach a FLV file.
But when I want to see it, I have a SQL error with ParentID column does not exist.
Here is the error :
[User Error] Couldn't run query : SELECT "Video"."ClassName", "Video"."Created", "Video"."LastEdited", "Video"."Title", "Video"."Description", "Video"."VideoID", "Video"."ID", CASE WHEN "Video"."ClassName" IS NOT NULL THEN "Video"."ClassName" ELSE "Video" END AS "RecordClassName" FROM "Video" WHERE ("ParentID"=xx) Unknown column 'ParentID' in 'where clause'
I have checked the db and the Video : it did not contains ParentID field.
How do I solve my problem ? (Adding a Parent in Video.php)
Currently, on SS 2.4.1.
Thanks in advance.
20 August 2010 at 4:19am
Can I see your code?
20 August 2010 at 4:28am Last edited: 20 August 2010 4:29am
class Video extends DataObject
static $db = array(
'Title' => 'Varchar(100)',
'Description' => 'Text'
static $has_one = array(
//Make sure this come first
'Video' => 'FLV'
class VideoPage extends Page
static $has_many = array(
'Videos' => 'Video'
public function getCMSFields()
$fields = parent::getCMSFields();
$fields->addFieldToTab("Root.Content.Videos", new FileDataObjectManager(
class VideoPage_Controller extends Page_Controller
VideoPage.ss (called byHTML 5 code)
<% control Videos %>
<% control Video %>
<% end_control %>
<% end_control %>
I used most of the code Rishi posted.
Thanks for the look,
20 August 2010 at 5:15am
Your video object isn't reciprocating the $has_many relationship to VideoPage.
$has_one = array (
'Video' => 'FLV',
'VideoPage' => 'VideoPage'
20 August 2010 at 1:39pm Last edited: 20 August 2010 2:05pm
I misread the code put by Rishi (did not see the 'VideoPage' => 'VideoPage').
Thanks for the info and the time.
Now, have an error with GD.php and getimasesize(), i will check on the forums.
Found that my generate videos thumbnails was an empty/corrupted image file.
Had replaced the image and it works fine.
20 August 2010 at 4:06pm Last edited: 20 August 2010 4:06pm
This seems potentially really helpful. Thank you for sharing.
19 June 2011 at 6:39am
I'd like to change and embed the video in the page, rather than have the pop up.
There was a line of code to use rather than $VideoPopup(160x160, 500x400) for this to happen, but I can't find it in my files anywhere.
Can anyone remind me of what to add / change please or do I have a false memory that it existed?
20 June 2011 at 4:11am
|Go to Top||Next >|