Before the last update the module seems to work fine. Unfortunately all of a sudden it doesn't work, probably caused by the update. The following logs were found:
Log #1
Location: ../file/ajax/field_audio/und/0/form-xnhlXVG7ZkY1E7KHHRHmC6unxDe2DaJ9sS2iLTQ-TYw
Referrer: ../node/651/edit
Message: Theme hook jplayer not found
Log #2
Location: ../file/ajax/field_audio/und/0/form-xnhlXVG7ZkY1E7KHHRHmC6unxDe2DaJ9sS2iLTQ-TYw
Referrer: ../node/651/edit
Message: Notice: Undefined index: items in audiofield_jplayer() (regel 317 van ../sites/all/modules/audiofield/audiofield.players.inc).
Log #3
Location: ../file/ajax/field_audio/und/0/form-xnhlXVG7ZkY1E7KHHRHmC6unxDe2DaJ9sS2iLTQ-TYw
Referrer: ../node/651/edit
Message: Notice: Undefined index: instance in audiofield_jplayer() (regel 316 van ../sites/all/modules/audiofield/audiofield.players.inc).
Log #4
Location: ../file/ajax/field_audio/und/0/form-xnhlXVG7ZkY1E7KHHRHmC6unxDe2DaJ9sS2iLTQ-TYw
Referrer: ../node/651/edit
Message: Notice: Undefined index: entity in audiofield_jplayer() (regel 315 van ../sites/all/modules/audiofield/audiofield.players.inc).
Log #5
Location: ../file/ajax/field_audio/und/0/form-xnhlXVG7ZkY1E7KHHRHmC6unxDe2DaJ9sS2iLTQ-TYw
Referrer: ../node/651/edit
Message: Notice: Undefined index: entity_type in audiofield_jplayer() (regel 314 van ../sites/all/modules/audiofield/audiofield.players.inc).
This is what is shown on "../file/ajax/field_audio/und/0/form-xnhlXVG7ZkY1E7KHHRHmC6unxDe2DaJ9sS2iLTQ-TYw"
[{"command":"settings","settings":{"basePath":"\/","pathPrefix":"","ajaxPageState":{"theme":"mytheme","theme_token":"77MUP0ZQrRYvDO3s4qIpphj14zEvUQfgKO80fIGUUxA"}},"merge":true},{"command":"insert","method":"replaceWith","selector":null,"data":"\u003Cdiv class=\u0022messages error\u0022\u003E\n\u003Ch2 class=\u0022element-invisible\u0022\u003EFoutmelding\u003C\/h2\u003E\nEr is een fout opgetreden. Het bestand dat werd ge\u00fcpload is waarschijnlijk groter dan de maximum toegestane bestandsgrootte (8 MB).\u003C\/div\u003E\n","settings":null}]
And this is what is on the lines mentioned in the logs (../sites/all/modules/audiofield/audiofield.players.inc):
function audiofield_jplayer($player_path, $audio_file, $options) {
return theme(
'jplayer',
array(
'entity_type' => $options['entity_type'], //line 314
'entity' => $options['entity'], //line 315
'field_name' => $options['instance']['field_name'], //line 316
'items' => $options['items'], //line 317
'settings' => array(
'autoplay' => 0,
'solution' => 'html, flash',
'preload' => 'metadata',
'volume' => 80,
'muted' => FALSE,
'repeat' => 'none',
'backgroundColor' => '000000',
'mode' => 'playlist',
),
)
);
}
What happens at the interface is the following. After selecting a file and hitting the upload button, the field only shows the remove button. When saving the node, the field shows nothing at view mode.
Comments
Comment #1
tamerzg CreditAttribution: tamerzg commentedYou will have to clear caches after the update, since theme hooks are removed in 1.0
Also jplayer is now implemented through drupal jplayer module:https://www.drupal.org/project/jplayer
so you will have to download and enable it.
Comment #2
apeter CreditAttribution: apeter commentedI have a similar problem.
I installed Audiofield 7.x-1.0, JPlayer module 7.x-2.0-beta1 and copied jplayer libraries in sites/all/player/jplayer.
Then I defined a new content type with a Audio Upload Field. I create a new content and try to upload a mp3 file.
When the upload complete the following errors appear:
Notice: Undefined index: entity_type in audiofield_jplayer() (line 314 of /... /sites/all/modules/audiofield/audiofield.players.inc).
Notice: Undefined index: entity in audiofield_jplayer() (line 315 of /.... /sites/all/modules/audiofield/audiofield.players.inc).
Notice: Undefined index: instance in audiofield_jplayer() (line 316 of /.... /sites/all/modules/audiofield/audiofield.players.inc).
Notice: Undefined index: items in audiofield_jplayer() (line 317 of /.... /sites/all/modules/audiofield/audiofield.players.inc).
Notice: Undefined index: entity keys in entity_extract_ids() (line 7760 of /.... /includes/common.inc).
Notice: Undefined index: entity keys in entity_extract_ids() (line 7761 of /... includes/common.inc).
Warning: Invalid argument supplied for foreach() in jplayer_sort_files() (line 114 of /.../sites/all/modules/jplayer/includes/jplayer.theme.inc).
Notice: Undefined variable: player_type in jplayer_sort_files() (line 193 of /.../sites/all/modules/jplayer/includes/jplayer.theme.inc).
(Note that in this log I replaced the first part of the path containing the site name with "/...".)
Despite these errors I can see a "rather corrupted" widget with the uploaded file.
I can even save the content and when I switch from "Edit mode" to "View mode" everything seems ok.
Any suggestion to solve this problem?
Thank you in advance.
PS: I tried to clear the cache as previously suggested but nothing changed.
Comment #3
Anonymous (not verified) CreditAttribution: Anonymous commentedSame problem here. When loading the edit page for a node which includes an already-populated AudioField, I get the same set of errors that apeter did in #2. I am using AudioField 7.x-1.0, jPlayer 7.x-2.0-beta1 (without jplayer_protect), and I am using v2.9.2 of the jPlayer library.
Comment #4
Anonymous (not verified) CreditAttribution: Anonymous at Websolutions Agency commentedInstall jPlayer drupal module: https://www.drupal.org/project/jplayer
Closing issue, audiofield work good with jplayer drupal module
Comment #5
Anonymous (not verified) CreditAttribution: Anonymous at Websolutions Agency commentedComment #6
Anonymous (not verified) CreditAttribution: Anonymous at Websolutions Agency commentedComment #7
Anonymous (not verified) CreditAttribution: Anonymous commentedSo was the jplayer module changed in some way to fix this? I'm not using either module at this point, so I can't test them easily, but the comments above indicate that both AudioField and jPlayer modules were in use. The documentation at https://www.drupal.org/node/973194 also still indicates that the modules can be used in conjunction.
Just making sure that there was actually a fix made somewhere.
Comment #8
ws.agency CreditAttribution: ws.agency at Websolutions Agency commentedComment #9
Daniel.Moberly CreditAttribution: Daniel.Moberly commentedFixed in latest dev release - removed the field formatter that would display the audio player on the node edit page. This is not necessary - we dropped it for the default file upload interface.