warning: Missing argument 1 for views_bonus_audio_player() in /home/un/public_html/demo/drupal5/sites/all/modules/views_bonus/views_bonus.module on line 687.
warning: Missing argument 2 for views_bonus_audio_player() in /home/un/public_html/demo/drupal5/sites/all/modules/views_bonus/views_bonus.module on line 687.
warning: Missing argument 3 for views_bonus_audio_player() in /home/un/public_html/demo/drupal5/sites/all/modules/views_bonus/views_bonus.module on line 687.
warning: Invalid argument supplied for foreach() in /home/un/public_html/demo/drupal5/sites/all/modules/audio/audio.module on line 1296

Just installed the 0.2 release of the audio module. The above errors show when selecting the "players" tab in audio settings.

views_bonus 1.0 installed. I don't see a newer public release. Should I be using the dev version of views_bonus ?

Comments

drewish’s picture

Project: Audio » Views Bonus Pack
Version: 5.x-0.2 » 6.x-1.x-dev

i think this is an issue with the views bonus pack

vm’s picture

disabled view_bonus for the time being, error removed.

merlinofchaos’s picture

Aww nuts. audio.module went and invented a hook and I happen to have a function by that name, I think. That function will have to be renamed.

drewish’s picture

sorry about that. i'm thinking about adding the following code to the audio.module if it'd make your life easier:
<?php
/**
* Build HTML to play an XSPF playlist.
*
* @param $url
* URL of the playlist
* @param $playername
* Optional, name of a player to use. See audio_get_players() for a list
* and then ensure that they return a 'theme_xspf' function.
* @return
* HTML to play the audio tracks.
*/
function audio_get_xspf_player($url, $playername = NULL) {
if (empty($playername)) {
$playername = 'xspf_extended';
}
$player = audio_get_players('name', $playername);
return theme($player['theme_xspf'], $url);
}
>?

merlinofchaos’s picture

Well. No need to do it just for me; my code needs to adapt to yours. I just gotta find the time to do it.

drewish’s picture

well i want to centralize the xspf player code in the audio module and make it accessible to other modules and since you're one of those other modules i'd love your input.

bonobo’s picture

Short of uninstalling views_bonus, is there a workaround for this? I'm using views_bonus for a few other views on a site where I'd like to use the audio module --

I'm currently using dev branches of audio and views_bonus.

Thanks,

Bill

merlinofchaos’s picture

Two workarounds:

1) Disable the audio plugin for the bonus pack; that'll stop it.
2) edit the audio plugin and rename the function that's colliding. What you rename it to is irrelevant, just be sure to get all the calls to it as well. They'll all be in the same file.

bonobo’s picture

Sweet -- thanks

merlinofchaos’s picture

Title: Missing arguments ? » Conflict with audio.module -- function name needs changing

Changing title to make this a bit easier to find.

newdru’s picture

can you be more specific.. which function name needs to be renamed?

i'm getting the same error. thanks

newdru’s picture

figured it out:

change:

views_bonus_audio_player

to

views_bonus_audio_playerb

vm’s picture

corrrect.

for anyone else who stumbles on this problem. here is the code to look for

in the views_bonus.module open FIND:

function theme_views_bonus_audio_playlist($view, $nodes, $type) {
  if (isset($_GET['playlist'])) {
    return views_bonus_audio_playlist($view, $nodes, $type);
  }
  else {
    return views_bonus_audio_player($view, $nodes, $type);
  }
}

function views_bonus_audio_player($view, $nodes, $type) {
  global $base_url;

  $flash_mp3_player = $base_url .'/'. drupal_get_path('module', 'audio') .'/flash_mp3_player/';
  $options = array_merge((array) $options, array(
    'file' => url($view->real_url, 'playlist', NULL, true),
    'config' => url($flash_mp3_player . 'config.xml'),
  ));

and REPLACE with:

function theme_views_bonus_audio_playlist($view, $nodes, $type) {
  if (isset($_GET['playlist'])) {
    return views_bonus_audio_playlist($view, $nodes, $type);
  }
  else {
    return views_bonus_audio_view($view, $nodes, $type);
  }
}

function views_bonus_audio_view($view, $nodes, $type) {
  global $base_url;

  $flash_mp3_player = $base_url .'/'. drupal_get_path('module', 'audio') .'/flash_mp3_player/';
  $options = array_merge((array) $options, array(
    'file' => url($view->real_url, 'playlist', NULL, true),
    'config' => url($flash_mp3_player . 'config.xml'),
  ));

I posted more code then necessary to make it easier for others to find. I've changed views_bonus_audio_player to views_bonus_audio_view in the 2 instances necessary.

When merlin gets a chance to update the module, you won't have to remember to fix this as he will have it changed.

lionheart8’s picture

Hi,

I have been having this same error resulting in the following:



    * warning: Missing argument 1 for views_bonus_audio_player() in /home/xprt007/public_html/drupal5/modules/views_bonus/views_bonus.module on line 687.
    * warning: Missing argument 2 for views_bonus_audio_player() in /home/xprt007/public_html/drupal5/modules/views_bonus/views_bonus.module on line 687.
    * warning: Missing argument 3 for views_bonus_audio_player() in /home/xprt007/public_html/drupal5/modules/views_bonus/views_bonus.module on line 687.
    * warning: Invalid argument supplied for foreach() in /home/xprt007/public_html/drupal5/modules/audio/audio.module on line 1313.

It has made me drop using Views for the time being.

When I tried replacing that portion of code in the v_b_module, I still get the above error.

Apparently, there was no conflict when the original versions of both the audio + views bonus modules where introduced to Drupal 5.0. I remember using both of them.

The problem started coming up when some updates came, though I dont remember of which module and have remained ever since.

:(

Not good for someone who needs both modules.

I wonder what one could do.....
Meanwhile, going back to disabling the views module :(

vm’s picture

The error was exactly the same ? even after the function names were changed ? That shouldn't be....

stefgosselin’s picture

Exacatly, comment #14 has erred somewhere along the line, as my install from mar-30 tarball gave out the error everyone mentionned in this post.

I had already spotted the duplicate function by the time I found this thread ( thanks google).

The simple renaming of that function was the trick, and works 100% fine, as this function is not referenced anywhere else in audion module ( as per grep results.

Which brings up my own question ... how about getting the module admin to patch his code ? , although it's a trivial issue, it is a small hindrance nonethelesse. Made me lose a half-hour . ;o)

vm’s picture

it is patched in the -dev tarball. merlin just hasn't branched it yet.

digitalfrontiersmedia’s picture

Title: Conflict with audio.module -- function name needs changing » What the...

I'm taking back all the nasty things I was about to say about you. :-)

The code you listed:

function theme_views_bonus_audio_playlist($view, $nodes, $type) {
  if (isset($_GET['playlist'])) {
    return views_bonus_audio_playlist($view, $nodes, $type);
  }
  else {
    return views_bonus_audio_player($view, $nodes, $type);
  }
}

function views_bonus_audio_player($view, $nodes, $type) {
  global $base_url;

  $flash_mp3_player = $base_url .'/'. drupal_get_path('module', 'audio') .'/flash_mp3_player/';
  $options = array_merge((array) $options, array(
    'file' => url($view->real_url, 'playlist', NULL, true),
    'config' => url($flash_mp3_player . 'config.xml'),
  ));

is not in views_bonus/views_bonus.module. It's in views_bonus/plugins/audio_playlist.inc!!

I was getting really perturbed thinking I didn't have the right decoder ring or secret handshake or something. :-)

vm’s picture

when i made that post, it WAS in the views_bonus.module. it has only been recent that the dev, refactored and moved code area to create this "plugin" type system.

vm’s picture

Title: What the... » Duplicate function in audio.module

changing title back from unnecessary change to what the ...

schnizZzla’s picture

views_bonus march tarball fixes this issue for me, too

dmitrig01’s picture

Status: Active » Fixed

Fixed.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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