Normally with a node-reference field, you can pull fields from a distant content-type into views as follows:

Referrer -> Node_Reference_Field -> Reference -> Field

However, using field_kaltura, you cannot pull the referenced video's fields into views, because no relationship handler is provided

Custom_Video_Type -> **field_kaltura relationship doesn't exist** -> node_kaltura -> kaltura item number of plays

I tried writing a patch to add a relationship on field_kaltura_value -> node_kaltura.kaltura_entryId (the field used to tie the tables together in the module), however: field_kaltura entries are stored as a comma-delimited string for multiple values, which is *not* First Normal Form, and therefore cannot be used in views API. I tried working around it using hook_query_alter, adding LIKE & FIND_IN_SET clauses, etc. but it's impossible to add this relationship via Views API unless the table is 1NF.

Aka, to get relationships into the module, the field storage needs to be overhauled. Better to use node_reference.module anyway, cause then you get all that work outa-the-box; but if not, just 1NF-it.

CommentFileSizeAuthor
relationship.diff2.28 KBlefnire

Comments

thommyboy’s picture

any "out of the box" solution for that? I think it's a pretty common usecase to use Kaltura Media inside a contenttype and then having the need to display more then just the media using a view. In my usecase I need the download-link but can't access it because it's available only in the Kaltura Contenttype but my view ist using MY contenttype and I can't establish a Relationship...

xurizaemon’s picture

Category: bug » feature

I'm open to submission of a patch to overhaul field storage so that this feature can be implemented.

FWIW, I think an even better option might be if the Kaltura CCK module was able to cope without node_kaltura entirely.

CCK could simply retrieve K entries by direct communication with the K server without the requirement to create entries in the node table for local storage.

I'm currently fully committed, and won't be able to review or accept patches for a week or two, but I am keeping an eye on the queue still.