Problem with the audio attach module. I installed the latest 6.x-dev and I got the error in the title from audio_attach.module.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

drewish’s picture

this was duplicate of #294317: Fatal error: Call to undefined function audio_prepare() in /my_path/audio_attach.module on line 153 but i'm referencing this one from some other places so this stays active.

drewish’s picture

zirafa’s picture

Yea. I have pretty much stepped away from drupal dev work for the time being. If I get a chance to look at audio_attach I'll try. It's not a very complicated module but I just haven't had the eyeballs as of late.

zirafa

g76’s picture

subscribing. same issue.

randyesq’s picture

subscribing. same issue too. What is the problem, the function is in there, isn't it?

drewish’s picture

randyesq, no that function disappeared as part of the upgrade for D6. audio_attach hasn't been fully upgraded.

randyesq’s picture

Drewish-

Thanks for the update! I know you will get to this when you can, but please know that people (me especially) are excited to see it available and test it out!

Thanks for a great module,
randyesq

RyanFC’s picture

subscribing

white-raven’s picture

subscribing.

speersd’s picture

Is there a work-around? Does batch upload work?

jorisx’s picture

Subscribing, or if some one knows about a work arround of hack to fix it, please let me know :)
Still a Great module! :-)

jackread’s picture

subscribing - would love to see this working or find a work around.

drewish’s picture

I'm working on revamping this module to use a CCK nodereference rather than the current system.

drewish’s picture

Status: Active » Needs work
FileSize
26.88 KB

Here's a first pass that creates the CCK field and migrates the data into it. It's got a field formatter that replicates the old look.

Things that need to be done:
- add a default view and use that to select nodes so that people can control the permissions.
- add some elements to the nodereference form for uploading files.
- update the documentation to describe what the new version does.

If people test this out make sure you back up your database before hand.

drewish’s picture

Status: Needs work » Active
FileSize
21.22 KB

A little follow up on this to clarify where it sits. You need to install before using this. It will display your upgraded attachment data and let you input new attachments. It will not let you upload files and attach them directly to a node, you'll need to upload them first.

I'm going to go ahead and commit this and but leave the .info marking it as incompatible.

yched’s picture

drewish, just took a peek at the commit, got a minor remark :
The formatter basically computes a separated output for each individual value (and then themes the whole as a ul), so I'm not sure it really deserves to use

 'multiple values' => CONTENT_HANDLE_MODULE,

which rather aims at grouping multiple values in a single 'display' (for instance in a graph, a gmap or an image slideshow).

(granted, we currently miss generic 'ul / ol / comma-separated' display options for multiple values)

drewish’s picture

FileSize
3.72 KB

yched, yeah it did seem a little much for such a simple bit of themeing but I'd asked on IRC and it seems like other people are mis(?) using it the same way.

here's some fixes to the README.txt and installer to actually stop them if CCK isn't installed or updated. Committed to HEAD.

drewish’s picture

Title: Fatal error: Call to undefined function audio_prepare() » Update audio_attach to D6
drewish’s picture

I think I need to add an admin form to let people select which nodes should have the attached audio and create the field(s) accordingly. that way the people who want to DIY it can do that and everyone else can have a one click field setup.

RyanFC’s picture

FileSize
123.1 KB

Hello, I've run into some problems. I patched the files with the above, then I went to my module list and I see the screenshot which I've attached.
Audio Attach is checked and greyed out, but below, Content is greyed out thus I can't check it. any ideas?
thank you!

drewish’s picture

RyanFC you don't need to patch anything at this point. it's included in the current version of the module. you'll need to install CCK though as it says on the project page.

RyanFC’s picture

Thank you, I really appreciate it. Unfortunately I still seem to be stuck. I have CCK and the updated audio module installed and everything appears to be as I need it in the modules admin. So now, I'm reading, "You can now add a new node reference field and use "Attached audio" as the display type." and under Usage says "Create or edit a content type that has audio attachments enabled"

So I assume my next step is to add a new node reference field. Could you direct me to information on how to do that? (my search didn't return anything that helped me)
When I have that in place I'll need to edit a content type that has audio attachments enabled. I assume I create a content type "Playlist" and enable audio attachements? ..will "enable audio attachements" be an option in the content type setup page?

thanks so much,
Ryan

RyanFC’s picture

well I've at least found what the problem is. the CCK tabs aren't showing up for me! ..some other module or something must be conflicting with CCK. I have the most recent verison of CCK installed but the "add field" links and tabs don't show up.

should anybody read this and have any ideas, let me know.
thanks!

RyanFC’s picture

at this point I can't tell if my installation is working correctly or I simply don't know how to use all the pieces of this module (and documentation in near non existent as far as I can find)

Does the audio feeds piece work for drupal 6? I that enabled but nowhere do I find any options of how it works to create an actual xspf or m3u

I created a content type called playlist and added a new field (i titled it "attached audio"). here is an example http://freight.scd2.net/freight-radio
you'll see that it has links to 3 audio nodes, instead of playing those 3 nodes in a player.

It seems like I'm on the right track but I don't see any way or any instruction to make a playlist work thus far. I have everything enabled and I created the content type and the field. Should the field already be an option in the manage fields area of a content type? (I created my own, but I"m wondering)

any assistance on this would be greatly appreciated. I'd then be happy to type up some instructions or notes for other users who may run into this.

thanks and merry christmas!

PS - I created a admin user for my dev drupal installation viewable at the link above if anyone has a minute to take a look. The login info is user: audiohelp pwd: audiohelp

drewish’s picture

as the release notes state audio_feeds hasn't been updated. it's structured in a way that isn't condusive to updating to the new views2 paradigm.

mariagwyn’s picture

I would like to test this out. I have a CCK content type with is primarily text, but sometimes has an audio file attached to it. I am having trouble figuring out how to attach the actual audio file. I set up a CCK node reference field, which links perfectly to the audio node, but I was hoping to actually show the flash player in the text node. I am assuming (perhaps incorrectly) that this is what audio attach does. I have also set up a view which I can use to display, but it does not seem to help. I know that at some point, I saw an option for "attached audio", but I can't remember where I saw it, CCK or Views. And I am not finding it again.

Any tips for how to start this process?

Thanks,
Maria

jyg’s picture

I'm using the dev version (6.x-1.x-dev) from 2008-Dec-22 and I also do not see the audio widget come up in the nodereference field selection list. I see some people say that this works... some say it doesn't. I haven't been able to figure out why its not working for me. FWIW, I'm using CCK 6.x-2.1. I wonder if there's some special order in which I have to do things...

thanks,

jyg

Sakrecoer’s picture

subscribing
i seem to be missing the attach audio widget in the selection field...

Anyways, thanks a billion for your hardwork! This module is what i use drupal for :)

Steve Hanson’s picture

Likewise - I cannot seem to get either dev or unstable3 to work - when I try to create the nodereference field, I dont get any options for the field other than the usual suspects - select list, checkboxes, etc. If I use select list, I can then set the display field to be an audio widget - so I can select between the existing audio nodes - but there's no widget to upload a new one, which makes this not very useful.

chaimkut’s picture

Component: Code » audio_attach

I'm having a similar problem as reported above. I've enabled all the relevant Audio modules (most importantly Audio Attach), granted myself the appropriate permissions for modifying audio, etc. Then:
-I add a Node Reference field in a Content Type
-When setting up the Node Reference field, I choose 'Content Types that can be referenced' to be 'Audio'
When I actually try to create an instance of this Content Type, the 'Select list' widget for the Node Reference field returns no values ('None'). This is also true when I try to use 'Advanced - Nodes that can be referenced (View)' and choose a View which I know returns multiple values, the Select list nevertheless returns 'None'. (Though I'm not sure if this is related to my use of Views2 or not). One strange thing is that often when I setup this Node Reference field and then click 'Save', when I try to edit the Node Reference field again, my previous settings are not saved.
(These attempts have been made with Drupal 6, with both Audio 6.x-1.0-unstable3 and Audio 6.x-1.x-dev ).

I'm not sure if any of this is correct though, since the README instructs:
Create or edit a content type that has audio attachments enabled

What does "enabling" audio attachments for a particular content type mean? (Simply adding a Node Reference field?)

The README also explains:
This module provides additional CCK formaters for nodereference fields

Although I don't seem to see that the Node Reference field is particularly unusual ...

All I want to do is import/add an Audio item and then be able to reference it inside of another Content Type. Has anyone succeeded at getting this to work? Thanks.

mariagwyn’s picture

FileSize
3.57 KB

Chaim, I received your email. Yes, I did get something like this to work, but it is hardly ideal. Here is the process:

1. Create a view that is specifically an audio embed ONLY view. I have uploaded a text file which exports my view.
2. Create a field using VIEW FIELD module, and select "audio_embed" as the only "allowed view."
3. The CCK field (using the NID) now calls the node view of audio_embed. This is not ideal, b/c the node view adds material I don't really want, but neither the list nor table options work to show the embedded audio player. I cheat and use CSS to remove things I don't want (so .view h2 {display:none;}, etc.). I would upload a picture of the final result, but I can't get my screenshot to work on my mac. Grrr.

Hope that helps. It is clunky, but it works for what I need, showing the audio player in non-audio nodes.

Maria

AndyThornton’s picture

Hello,

I don't know if this will help anyone, but maybe? I also wanted to embed uploaded audio on page of different type. I added a Node Reference to my page. I called my reference field_article_audio. I use contemplate to lay my node out as I want it (it is an alternative to doing it all in the theme files, but if that is your approach I am sure you can adapt this little snippet). Anyway, so in my contemplate code I do this:

$audio_link = $node->field_article_audio[0]['nid'];
if ($audio_link) {
print audio_get_node_player (node_load ($audio_link));
}

This then displays a little player on my page.

Hope that helps. audio_get_node_player is a function in audio.module - the author may not consider it part of the supported API, though, so there is a danger this may not work in newer versions of audio.module.

Cheers,
Andy

mkeith’s picture

subscribing

hugafish’s picture

subscribing

zenasprime’s picture

I'd love to see this running... any ETA?

Vinc-2’s picture

Status: Active » Needs work

The node reference doesn't allow me to upload audio directly via the form like described in the readme.

discipolo’s picture

hi, as far as i can tell the
// checkbox in the node's content type configuration page.
is missing in the audio-attach module.

by replacing
// case 'TYPE_node_form': /
with
case ($form['type']['#value'] .'_node_form' == 'NODETYPEVARIABLE_node_form'):

and uncommenting the
Display currently attached files, ( we dont have _audio_attach_current_list fuction yet)
as well as the multiselectfield for existing audio files (because audio_attach_get_audio_nodes function is missing)

the upload module works again.

the form_alter code reads:
FIXME: This is broken; I'm not sure what $form['type']['#value'] is
// expected to be, but it certainly doesn't always exist.

and what that it is supposed to be is the configuration form.

case 'node_type_form':
if ($form_id == 'node_type_form' && isset($form['identity']['type'])) {
$form['workflow']['audio_attach'] = array(
'#type' => 'radios',
'#title' => t('Attach audio files'),
'#default_value' => variable_get('audio_attach_'. $form['#node_type']->type, 0),
'#options' => array(t('Disabled'), t('Enabled')),
'#description' => t('Should this node allows users to attach audio files?')
);
}
break;

basically you have to replace TYPE in
TYPE_node_form
withyour contenttype manually,
i couldnt figure out exactly why $form_id doesnt contain this value... (see http://api.drupal.org/api/function/nodeapi_example_form_alter/6)

all the best!

discipolo’s picture

FileSize
6.22 KB

gotta set one value...

kasha_x’s picture

subscribed. I'm testing the latest dev on a soon-to-determined site.

donations to the developers on release of a bug-free module. we're not midas, but maybe if everyone had this outlook these issues would get resolved.

drewish’s picture

anyone want to roll a patch for this? i've got no idea what changes are supposed to work.

liveoutloud2day’s picture

Looks like between audio-6.x-1.0-unstable2 and audio-6.x-1.0-unstable6 much of the module got stripped out. It may be intentional, because that is what the module will become, but I can't get any functionality at all with the new module. With unstable2 (of just attach), and a small little patch, I can actually attach audio nodes to other nodes. I can't however move them up and down in the list, as I am using the older code with the up and down arrows, or the ajax/ahah code is not triggering. If anyone knows what is happening with the stuff being removed, that would be great to get a functioning attach module... The small patch to the unstable2 is related to the code in #37 and #38

the form_alter code reads:
FIXME: This is broken; I'm not sure what $form['type']['#value'] is
// expected to be, but it certainly doesn't always exist.

and what that it is supposed to be is the configuration form.

case 'node_type_form':
if ($form_id == 'node_type_form' && isset($form['identity']['type'])) {
$form['workflow']['audio_attach'] = array(
'#type' => 'radios',
'#title' => t('Attach audio files'),
'#default_value' => variable_get('audio_attach_'. $form['#node_type']->type, 0),
'#options' => array(t('Disabled'), t('Enabled')),
'#description' => t('Should this node allows users to attach audio files?')
);

I was looking at the module autonode_title, because it happened to be on the site I was working on, and it inserts it self on every node edit page and content_type edit page, so I thought it would be a good one to look at. Instead of using $form['type']['#value'] to get "this" form, they use $form['#node']->type - so I think that will work. Attached is a patch of unstable2 attach module that just doesn't sort, but might be way off, since I put things back to how they were before the attaching part was gutted (hook_nodeapi).

Maybe now someone who knows the nodeapi part, and where it is going can take it from here, now that we are over the

FIXME: This is broken; I'm not sure what $form['type']['#value'] is
// expected to be, but it certainly doesn't always exist.

hurdle.

Hope it helps!

Liveoutloud2day

udvranto’s picture

Subscribing...