Needs work
Project:
Kaltura
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
24 Aug 2009 at 06:48 UTC
Updated:
17 Jan 2017 at 09:32 UTC
Jump to comment: Most recent
has anyone implimented
http://www.kaltura.org/delete-files-kaltura-db-when-deleting-nodes
and willing to share the code?
thanks,
joseph
Comments
Comment #1
MaffooClock commentedFYI: looks like that link is broken now.
Comment #2
jacerider commentedSomething like this should work:
Comment #3
Apfel007 commentedHi JaceRider,
I tried to implement it in the kaltura.module. But I seems to work not in that way I did it.. is the "if" wrong implemented?
Cheers
Comment #4
jacerider commentedI don't know bud, that looks like it should work to me.
Try doing a dsm($result); after the line "$result = $kaltura_client->deleteEntry($session_user, $node->kaltura_entryId);" and see what it returns. (Make sure you have the devel module installed, otherwise do print_r($result))
If I remember correctly, the message that is displayed should tell you what the issue is.
Comment #5
Apfel007 commentedHi JaceRider,
I got this:
Array ( [result] => Array ( [serverTime] => 1257865714 ) [error] => Array ( [0] => Array ( [code] => MANDATORY_PARAMETER_MISSING [desc] => Mandatory paramter missing [entry_id] ) ) [debug] => Array ( [sigtype] => 1 [signature] => d094f66cd60462b6ee2854ea055248b3 [execute_impl_time] => -1257865714.0101 [execute_time] => 0.067968130111694 [total_time] => 0.0689699649811 ) )
Comment #6
jacerider commentedWell, it would seem something is wrong with "$node->kaltura_entryId". I would do a dsm of $node and make sure that kaltura_entryId is listed in that object. If it isn't, that's why it isn't working and you will need to track down why it isn't there.
Comment #7
bentekwork commentedI get this message when trying the method listed above. Any ideas on what I need to add?
Fatal error: Call to undefined method KalturaClient::deleteEntry()
Comment #8
xurizaemonAt a guess, your node has Kaltura items attached via CCK and so $node->kaltura_entryId is not populated.
For this to go in you will need to provide UI for the user to *optionally* select whether the referenced item should be deleted when the node is deleted. You'll also need to extract the Kaltura entryId from the field values, and bear in mind that this may be a comma-separated list of entries.
For field_kaltura, you'll need to implement in hook_field() instead of hook_nodeapi(). $op will still be 'delete'.
Comment #9
xurizaemonLooks like the Kaltura API code above is from the v2 API too. That will need to be updated for v3.
Comment #10
ramuchidambaram commentedI think it should be like this
<?php
require_once('lib/KalturaClient.php');
$config = new KalturaConfiguration();
$config->serviceUrl = 'http://www.kaltura.com/';
$client = new KalturaClient($config);
$entryId = null;
$result = $client->media->delete($entryId);
Comment #11
xurizaemon@ramu_chidambaram - this is a six year old issue for Kaltura 6.x-2.x-dev.
If you plan on working on this, go ahead! But you probably want to target a current release :D