System:
Drupal 5.7
PHP 5.1.x
MySQL 5.x

Problem: Creates "See Video" link when video field is empty.

To reproduce: Set thumbnail to create a thumbnail in teaser view and you get a link "See Video" The thumbnail is correctly created and the "See Video" links to the correct node/address. Changing the teaser setting back to full video or default fixes the problem. You can see the bug on http://test.tbsk.no/ (node 623 and 624).

It is introduced in 5.x-1.2. Have not been able to reproduce this on 5.x.1.0.

Cheers
Stein Magne

CommentFileSizeAuthor
#17 video_cck_see_video.patch684 byteslaken
#13 video_cck_see_video.patch514 bytesk8n

Comments

steinmb’s picture

Bump!

josoal’s picture

I have the same problem...
If I set cck embedded video to multiple values and no video is atached, I see 3 ""See Video"".
(sorry for my english)

steinmb’s picture

Looks like problem is in /contrib/video_cck/video_cck.module. They added some code that make the "See Video" link i it fails to create a thumnail and when the field is empty there is nothing to create a thumbnail from, and it fails and just print "See Video".

  else {
     // if all else fails, then just print a 'see video' link.
    if ($no_link) {
      $output = ''; //thickbox won't work without a thumbnail
    }
    else {
      $output = l(t('See Video'), 'node/' . $node->nid);
    }
  }

Somewhere in the code it is not doing a empty check first.

--
Stein Magne

josoal’s picture

Bump!

leoklein’s picture

Yup. Same problem here. Just started when I upgraded to 5.x-1.2.

leoklein’s picture

Total hack but you get rid of the 'See Video' if you do something like this:

  else {
     // if all else fails, then just print a 'see video' link.
    if ($no_link) {
      $output = ''; //thickbox won't work without a thumbnail
    }
    else {
     $output = ''; //thickbox won't work without a thumbnail
    }
Richard_’s picture

Thank you for the hack. Hopefully this will be solved in next version :)

lindsayo’s picture

Whew. That felt good. Gotta love finding an answer in the forums so easily. Thank you!!

steinmb’s picture

Months has past without any of the maintainers have released any official fix for this bug. I have just tested the last dev. version of 5.x.

aaron or Alex UA pls. respond if you find the time. Thanx for all your work on this awesome module!

Cheers
Steinmb

steinmb’s picture

Project: Embedded Media Field » Video CCK
Version: 5.x-1.2 » 5.x-1.x-dev
Component: Embedded Video Field » Code
Priority: Normal » Critical

Should prob. be moved to Video CCK

pereljon’s picture

Here's some smart code to check for the "see video" links to empty embedded media fields. Stole the "if ($item['value'] && $item['provider'])" code from just above where this edit goes...

     // if all else fails, then just print a 'see video' link.
    if ($no_link) {
      $output = ''; //thickbox won't work without a thumbnail
    }
    else if ($item['value'] && $item['provider']) {
      $output = l(t('See Video'), 'node/' . $node->nid);
    }
    else {
      $output = '';
    }
 
aaron’s picture

Project: Video CCK » Embedded Media Field
Version: 5.x-1.x-dev » 6.x-1.x-dev
Component: Code » Embedded Video Field

video cck has long been deprecated. moving back to emfield

k8n’s picture

Version: 6.x-1.x-dev » 5.x-1.2
StatusFileSize
new514 bytes

To accelerate the process, attached is a patch for pereljon's suggested fix created against version 1.2.

I have not investigated deeper yet, but I believe there is a larger issue here with video_cck (or emfield?). There is no reason why fields with empty values should be stored in the database at all. For instance, when video_cck field is set to allow multiple values on a node, once the node is saved, 4 empty fields are committed to the database. If we were to contrast this behavior against imagefield's, we'd probably notice that imagefield removes empty fields from the database all together. Wouldn't this be the desired behavior for video_cck (emfield?) as well?

joetsuihk’s picture

Version: 5.x-1.2 » 5.x-1.3
Status: Active » Needs review

the problem also finds in v1.3

agree with #13
but as we still do have have a patch that complete the idea,
maybe we can test the patch and commit it as a work around currently.

i think this issue should be solved before next 5.x version release..

matiki’s picture

Added the patch and made the two statements above them look like this = works!

    if ($no_link && $item['value'] && $item['provider']) { //thickbox requires the thumbnail returned without the link
      $output = '<img src="'. $thumbnail_url .'" width="'. $width  .'" height="'. $height  .'" alt="'. $image_alt .'" title="'. $image_title .'" />';
    }
    else if ($item['value'] && $item['provider']) {
      $output = l('<img src="'. $thumbnail_url .'" width="'. $width  .'" height="'. $height  .'" alt="'. $image_alt .'" title="'. $image_title .'" />', $link_url, array(), NULL, NULL, false, true);
    }

just add "$item['value'] && $item['provider']" to the if-statement and make the else to else if and add the same thing there.

lindsayo’s picture

-

laken’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new684 bytes

The patch in #13 no longer applies against 5.x-1.3. I've re-rolled it to work with the current release. New patch is attached.

This patch appears to work fine, without the additions in #15 above.

Can the maintainers commit this to the 5.x branch? Or could we at least get a review?

alex ua’s picture

Version: 5.x-1.3 » 5.x-1.x-dev

This approach sees fine to me, though it no longer applies to Drupal 6. I'm going to try and go through and commit the 5.x patches we have soon.

alex ua’s picture

Status: Reviewed & tested by the community » Patch (to be ported)

Changing Status.

aaron’s picture

Status: Patch (to be ported) » Fixed

committed. thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.