I drupal 7 site that I did not build but now maintain has developed an odd error. About a month ago the site lost the ability to add an image to a Media field inside a new addition of field collection. Looking into it, this is what I find:
The first few warnings are nothing that I can see would harm things. The media.popup.js error is nonsense:
dialogOptions.buttons[ok] = function () {
alert('hell yeah');
return "poo";
var formattedMedia = this.contentWindow.Drupal.media.formatForm.getFormattedMedia();
if (!formattedMedia) {
I have yet to see that code be reached, though it looks a little unprofessional to have such things in a contrib module.
When I scroll down the node edit form I see see the next segment. The Bulletin error has to do with Google Syndication code linked in, and can be ignored for now.
The piece of the screenshot after that is when I try to trigger the field collection's "Add Additional Item" button from the console. Nothing happens. I am not sure if I did it right, but I included it in this screenshot in case it helps identify anything.
The final segment shows the messages that appear when I click the Add Additional Item button. A new field collection instance is actually added to the form, and if the console was not open I would not know that something was wrong yet. I get from 2 to 5 instances of that "object is undefined" error any time I do this. The "too much recursion" error occurs about 1 in 15 tries, so I do not know if it is relevant. I have all cache and compression turned off, and this is a local virtual box copy of the live site so I do not have to worry about killing it in the investigation.
The problem is these "object is undefined" errors block the use of the Media module's Select Media button for a field on the node. First time this problem was noticed was when a new slide show entry was being added to an Article node. The Add collection button causes the error, and the Media button then does not respond but throws some "this.hoverable" error. I went over to another content type that has a field collection that contains only text, but also has a Media field on the node itself. The field collection generates the same error, I switch vertical tabs to get to the Media field and it behaves the same as the media field inside the collection. JQuery Update is used to keep the admin screens on jquery v1.5 because it is needed for the Media module.
Modules involved:
- Drupal 7.38
- Field collection (field_collection) Module Enabled 7.x-1.0-beta8
- Chaos tools (ctools) Module Enabled 7.x-1.7
- jQuery Update (jquery_update) Module Enabled 7.x-2.4
- Media (media) Module Enabled 7.x-1.5