I am trying to include Drupal bootstrap in my custom php scripts. I successfully use this method on other sites, but i cannot create bootstrap in one site where i have MediaFront installed.

OSM Player is in use and it works ok, but it is reported it causes an error:

PHP Fatal error: require_once(): Failed opening required 'sites/all/modules/mediafront/players/osmplayer/player/OSMPlayer.php'

while executing Bootstrap proces:

define('DRUPAL_ROOT', '/var/www/drupal');
require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);

I am thankfull for any hint that would help me resolve tihs issue!

Comments

travist’s picture

Status: Active » Closed (won't fix)

Please use MediaFront version 7.x-2.x. There is a video on how to migrate 1.x to 2.x here http://www.youtube.com/watch?v=4gBi7MOD0Q0.

I am not supporting MediaFront 7.x-1.x anymore, and am very confident this is fixed with 2.x.

NenadP’s picture

Thanks Travis, your support is really Legendary :) !
I would gladly update, but not sure if it will work with technique i use.

I load osm player in custom content type like this, to load video in osm player in pretty custom way...

$target_file = $node->field_mediafront_media['und'][0]['value'];
$videolink =$base_url . '/files/' . $path .  '/' .  $target_file; 
$node->field_mediafront_media['und'][0]['value'] = $videolink;

print render($content['field_localvideo']);

I will review the video, hope nothing will break and still can be rewritten to function this way... :)

travist’s picture

This has been replaced with the feature that you can now make a plain Text field (which can have just a link to a video) have a formatter of MediaFront Player which will render your text link as a media player. So, what you are doing above should work just fine as long as you set the field_mediafront_media field to have the Field formatter of MediaFront Player, and then change print render($content['field_localvideo']); to just print render($content['field_mediafront_media']);.

You can then just delete the field_localvideo which I assume was the hacky Media Player field.

NenadP’s picture

Thanks! I will dive into it. I am carefull because i have few hundreds paths defined in content fields and editors would kill me if... :)
Other than that, it would be good to lay hands on your module new version goodies...
Thanks for your great work!