Trying to display the player when there are no items in the field causes an Undefined variable: player_type in jplayer_sort_files() error, and also uselessly adds the player's JavaScript to the page. The following patch solves those issues at their root by not trying to display the player when there are no items in the field to play.

#1192826: Undefined variable: player_type in jplayer_sort_files() targets the same error message but seems to address the problem in the case of Views.

CommentFileSizeAuthor
jplayer-no-items.patch1.16 KBDavid Lesieur
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

deviantintegral’s picture

Status: Needs review » Fixed

Thanks for the patch. I committed it in 135b2ee and added a small followup in fa75e5f to make sure the field label was hidden as well.

deviantintegral’s picture

Version: 7.x-2.x-dev » 6.x-1.x-dev
Status: Fixed » Patch (to be ported)

Actually, this needs to be tested in the 6.x-1.x branch as well.

deviantintegral’s picture

Status: Patch (to be ported) » Fixed

I committed a 6.x-1.x version of this (well, a totally different solution) in d1f877a.

Status: Fixed » Closed (fixed)

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