Okay, I ran into this edge case the other day and thought i would document it.

If you have an complex page, say using panels and you are simultaneously displaying an embedded video in one pane and have a node add form in a different pane, the embedded media field thinks that the only allowable content provider is that of the displayed video.

I found the answer in the code. When emfield_system_list is called, it stores the list of providers in a static variable. If that list is then called a second time in the same invocation (like I am doing with panels) then it grabs the original provider list instead of finding the correct providers.

function emfield_system_list($module, $provider = NULL, $load = TRUE) {
  // Maintain a static list of providers.
    static $files;
  

  if (!isset($files)) {
    // Initialize our static variable.
    $files = array();
  }
  if (!isset($files[$module])) {
    // Initialize the file listing for the invoking module.
    $files[$module] = array();
  }

My solution was to comment out the 'static $files', but of course this will cause all subsequent calls to emfield_system_list to run over the disk looking for provider plugins. Anyhow, hope this saves somebody some hair.

Comments

Mixologic’s picture

Title: "You have specified an invalid media URL or embed code." - Form and Node display on same page breaks "allowable fields" » "You have specified an invalid media URL or embed code." - Form and Node display on same page breaks "provided services "
dcanetma’s picture

It happened the same to me aswell.

Commenting the static variable definition fixed the bug.

The strange thing is that the error started to raise from one day to anoher. I couldn't say what action, ( no module or core updates have been done ), could make this happen.

avpaderno’s picture

Version: 6.x-1.9 » 6.x-1.x-dev
Issue summary: View changes
Status: Active » Closed (outdated)

I am closing this issue, as it has been created for a release that is now not supported.