after upgrading to 6.x-1.0-beta4 this error started occurring and the player does not show up

Comments

jrglasgow’s picture

StatusFileSize
new1.3 KB

it looks to me that the problem is that I used the new feature in MediaFront to export the mediafront presets as a feature.

the function mediafront_get_preset() only checks the database for preset information

/**
 * Get's the preset.
 */
function mediafront_get_preset( $preset_name ) {
  $preset = db_fetch_array( db_query("SELECT * FROM {mediafront_preset} WHERE name='%s'", $preset_name));
  $preset['settings'] = unserialize( $preset['settings'] );
  $preset['connect'] = unserialize( $preset['connect'] );
  $preset['default'] = false;

  // Return the preset.
  return $preset;
}

while all your preset lists allows modules to add presets as well, this is how the feature works, I modified the mediafront_get_preset() function to use the mediafront_get_presets() function to get all presets.

/**
 * Get's the preset.
 */
function mediafront_get_preset( $preset_name ) {
  static $presets = array();
  if (empty($presets)) {
    $presets = mediafront_preset_get_presets();
  }
  $preset = $presets[$preset_name];

  // Return the preset.
  return $preset;
}

attached is a patch to make this change

jrglasgow’s picture

Title: No preset defined to declare the OSMPlayer object! » Error: No preset defined to declare the OSMPlayer object!
travist’s picture

Status: Active » Patch (to be ported)

Nice!

I will review this and commit soon if all is well. Thank you so much for your efforts!

Travis.

that0n3guy’s picture

I just tested this and it does seem to fix the error.

that0n3guy’s picture

Status: Patch (to be ported) » Needs work

This does fix the issue, BUT it breaks the regularly created presets with the same error.

jrglasgow’s picture

Status: Needs work » Needs review
StatusFileSize
new1011 bytes

This patch checks to see if there is any settings for the preset, if not it looks for a default preset in code.

It should take care of the problem mentioned in #5

that0n3guy’s picture

From what I can tell, this works perfectly. Both preset "types" work correctly now.

matze999’s picture

Mmmh,

i tried to apply the patch on both beta-4 and the dev version but both times it fails with:
Hunk #1 FAILED at 595.
Hunk #2 FAILED at 654.

Tried to apply the patch manually, but the error persists.

not sure what to do at this point.

Any help would be appreciated
matt

memoo’s picture

subscribe

patmacs’s picture

I had a similar problem but I didn't apply the patch to fix it. I just added the correct media field to the view and then selected that field when adjusting the MediaFront setting for the view. I guess that if it doesn't have the right media field, it'll throw a fit. Hope that helps.

jazzslider’s picture

Hello!

I received this same error when using Mediafront on Drupal 7. In my case, it turned out that the problem was underscores in the machine name of the Mediafront Preset I had created. To resolve, I re-created the preset without underscores or any other special characters, and then assigned the new preset to the view. This took care of the issue for me.

This particular problem could be solved either by adjusting the code that failed when special characters were in the preset name, or by adjusting the field help stating that underscores, hyphens, and so forth are acceptable characters in the preset name.

Thanks!
Adam

naeluh’s picture

I tried to use patch on #6 and I reporting the same as #8.

I am not sure if this is related but in the 6.1.3 and dev I am showing a hidden in the display dropdown in cck display tab.
After I have had a working install for about a year and now it is broken.

Please advise

TC44’s picture

Same issue here, on both the lastest release and dev...

*edit - scratch that, reinstalled and it's working fine now here.