i get this error in when i want to update to the latest dev with the update script.

// Er is een AJAX HTTP fout opgetreden. HTTP-resultaatcode: 200 Debug informatie volgt. Pad: .................... Statustekst: OK Antwoordtekst: Fatal error: Call to undefined function file_type_save() in media_youtube/media_youtube.install on line 170 //

i deleted the path.
could this problem be fixed, well its my first drupal page i dont know allot of it at this moment.
could someone explain what this means, thanks in advance.

CommentFileSizeAuthor
#6 youtube-module-update-problem.png50.49 KBAbilnet
#2 error.png11.18 KBdatak

Comments

datak’s picture

Is this a problem nobody knows? hmm first time i use drupal and i have a problem that nobody knows :(

i saw this post http://drupal.org/node/128878 so i get into that hopefully i can think some stuff out.

datak’s picture

StatusFileSize
new11.18 KB

well know i get allot of others error (see image) what the H*** do i need to do know lol.

the entire error line was media_youtube.theme.inc

the error is on line 98 there is the tekst $variables['classes_array'] = array_merge($variables['classes_array'], $variables['options']['attributes']['class']);

datak’s picture

this topic could be closed. thank you.

dave reid’s picture

Status: Patch (to be ported) » Fixed

Marking as fixed.

leslieg’s picture

Version: 7.x-2.x-dev » 7.x-2.0-rc2
Assigned: datak » Unassigned
Category: support » bug
Status: Fixed » Active

This error was first reported in the dev version and had been reported as fixed, however I received the error today when attempting to upgrade media_youtube module from media_youtube 7.x-2.0-rc1 to the new recommended release (as of 2/23/2013) of media_youtube 7.x-2.0-rc2. The error occurred when running the database updates.

error is Fatal error: Call to undefined function file_type_save()
in sites/all/modules/media_youtube/media_youtube.install on line 172

this issue # was not listed in the release notes as having been fixed, however the 7202 update script (function media_youtube_update_7202) assumes this function exists

Abilnet’s picture

StatusFileSize
new50.49 KB

I also got errors (screenshot attached) when running update.php after upgrading the module from version: 7.x-1.0-beta3 to the latest (recommended) version: 7.x-2.0-rc2

vegantriathlete’s picture

Fatal error: Call to undefined function file_type_save in media_youtube.install on line 172

This is what the code looks like in the .install for update 7202.

/**
* Update Media YouTube files to the new video file_entity type.
*/
function media_youtube_update_7202() {
  // Required to run file_displays_load() in update.php.
  module_load_include('inc', 'file_entity', 'file_entity.file_api');
  $video_type = file_type_load('video');
  $video_type->mimetypes[] = 'video/youtube';
  // maybe also add stream if is not there already?
  file_type_save($video_type);

  // Update existing files
  db_query("UPDATE {file_managed} SET type = 'video' WHERE type = 'undefined' AND filemime = 'video/youtube'");
}
aaron’s picture

what version of the file_entity module are you using? You need to use 7.x-2.x of both that and the media module.

vegantriathlete’s picture

I am using Media 7.x-1.2 and Media: YouTube 7.x-2.0-rc2. So, I'm not using the stand alone file_entity project at all. It's the one that is bundled with Media.

Let me see if I'm causing a mismatch in the Media and Media: YouTube modules.

vegantriathlete’s picture

It appears that the issue is indeed a mismatch between Media: YouTube and Media.

What is the recommendation here?

The Media module says that we are supposed to use the 7.x-1.2 branch; the 2.x branch is listed as unstable.

The file_entity project has the 2.x branch listed as unstable, and this is the branch that defines file_type_save. the 1.x branch is not even listed any more.

Media: YouTube says the recommended release is 7.x-2.0-rc2.

The Media: YouTube 7.x-1.0-beta3 is listed under Other Releases.

Abilnet’s picture

Thanks for the question from Aaron, I updated both "media" and "file_entity" -modules to version: 7.x-2.0-unstable7 and managed to run "update.php" without any errors.

Thank you.

vegantriathlete’s picture

I would still like to see some clarification.

If you use drush dl media media_youtube file_entity you will get 7.x-1.2 of Media, 7.x-2.0-rc2 of Media: YouTube and 7.x-2.0-unstable7 of File Entity.

vegantriathlete’s picture

Component: Code » Documentation
Category: bug » feature

I don't know if calling this feature request for documentation is the exact right way to categorize this. But, I think it's about as good as any other way.

I don't think that there is an actual *bug* involved here. But, it's more than just a change to documentation IMO. Part of the problem is what is being set as the "Recommended releases." To my way of thinking, the recommended release of Media: YouTube should be 7.x-1.0-beta3 (and the recommended release of Media should remain 7.x-1.2).

sterndata’s picture

An AJAX HTTP error occurred. HTTP Result Code: 200 Debugging information follows. Path: http://www.sterndata.com/update.php?op=selection&token=-1jpVIM1RWPNhM0N7... StatusText: OK ResponseText: Fatal error: Call to undefined function file_type_save() in /var/www/www.sterndata.com/drupal/sites/all/modules/media_youtube/media_youtube.i... on line 172

But "drush up" is not reporting any outstanding updates.

vegantriathlete’s picture

@sterndata: What version of Media are you using?

leslieg’s picture

My installed versions were Media 7.x-1.2 and media_youtube 7.x-2.0-rc2 (I was attempting to update this from media_youtube 7.x-2.0-rc1 as recommended). The version of file_entity was 7.x-1.2, which was installed with the Media module, it was not a standalone install. I just updated file_entity to the recommended version of 7.x-2.0-unstable7, however the file entity page did state "The File entity project is not compatible with Media 7.x-1.x. You must use the File entity module bundled with Media 7.x-1.x."

update.php now works as file_type_save is now available.

I now have the versions that drush lists if you use drush dl media media_youtube file_entity - 7.x-1.2 of Media, 7.x-2.0-rc2 of Media: YouTube and 7.x-2.0-unstable7 of File Entity. Not sure I have the correct combination though based on the previous comments and the documentation. Any advice would be appreciated.

omd’s picture

same exact issue, subscribing

shaisamuel’s picture

@OMD, please don't just subscribe - please follow. This helps much better to count the people who are interested in a similar issue.

omd’s picture

ok gotcha! thanks!

sterndata’s picture

$ drush pml |grep -i media
 Media                   File entity (file_entity)                           Module  Enabled        7.x-1.2        
 Media                   IMCE (imce)                                         Module  Enabled        7.x-1.7        
 Media                   Media (media)                                       Module  Enabled        7.x-1.2        
 Media                   Media Gallery (media_gallery)                       Module  Enabled        7.x-1.0-beta8  
 Media                   Media Internet Sources (media_internet)             Module  Enabled        7.x-1.2        
 Media                   Media: YouTube (media_youtube)                      Module  Enabled        7.x-2.0-rc2 
vegantriathlete’s picture

1) If you are going to use Media: YouTube 7.x-2.0-rc2, then AFAIK you will need to use Media 7.x-2.0-unstable7 and File Entity 7.x-2.0-unstable7.

2) If you are going to use Media 7.x-1.2, then AFAIK you will need to use Media: YouTube 7.x-1.0-beta3. The stand alone File Entity project does not apply in this case.

@leslieg - I can't say at all what is going to happen with your combination. It's true that you have the File Entity stand alone. But, you also have the file_entity that is bundled with Media.

@sterndata - your issue is that as far as drush is concerned, you DO have all the latest recommended releases.

So, until aaron weighs in any differently (and what I am saying basically agrees with what he said in comment #8) I would suggest you pick either option 1 or option 2. Don't mix and match.

chrdr’s picture

I think that either the recommendations of media and media_youtube should be synchronized, or the documentation should at least contain a hint that the 2.0-branch of media_youtube needs the 2.0-branch of media and file_entity. Otherwise, if you take the recommended module versions, you will get errors without knowing why.

sterndata’s picture

agreed

vegantriathlete’s picture

See my comment in #13 that already stated this recommendation.

biigniick’s picture

#13 worked for me :-)

pagecarving’s picture

I see #13 solution, but how can you change out a module when it is dependent in the file structure and multiple content types.
my module mayhem includes:
youtube 7.x 2.0
media 7.x 1.3
file_entry 7.x 1.3

both media and file_entry are entrenched in the site.
Is there a step by step process to switch out modules with GIT?

mattbrand’s picture

I am in the same exact situation as comment #26, and not sure what to do about it.

Is the solution to roll back the Media module to version 7.x-1.2? And if so, is there an easy way to roll back a module to a previous version?

vegantriathlete’s picture

@pagecarving, @mattbrand: The solution in your instance is to disable and uninstall the media_youtube 2.x release and then install and enable the media_youtube 7.x-1.0-beta3 release.

Photoshopper’s picture

I'm uninstalled and install 7.x-2.0-rc2 and all right. Error don't displayed, video don't deleted.

kristofferrom’s picture

I get this error

Fatal error: Call to undefined function file_type_save() in /sites/all/modules/media_youtube/media_youtube.install on line 172

- Drupal core 7.20
- Media 7.x-1.3
- Media: YouTube 7.x-2.0-rc2

Any ideas?

avonleadesign’s picture

Why would it give me Media: Youtube 7.x-2.0-rc2 as an upgrade to Media: YouTube 7.x-1.x when I upgrade through #overlay=admin/reports/updates/update?

dave reid’s picture

Category: feature » bug
Priority: Major » Normal

This will be resolved with #1949520: Remove media_youtube_update_7202() and media_youtube_file_default_types_alter(). I encourage people to go subscribe to that issue, but not post a comment if you want to keep informed of its progress.

dave reid’s picture

Status: Active » Fixed

This has been officially resolved with #1949520: Remove media_youtube_update_7202() and media_youtube_file_default_types_alter() and will be available in the next release, or the 7.x-2.x-dev release within 12 hours.

sterndata’s picture

I have this update "stuck" in the list of updates to be performed. How do I remove it? What table does it live in?

creact’s picture

Same problem here. When updating database: 7202 - Update Media YouTube files to the new video file_entity type.
I get: An AJAX HTTP error occurred. HTTP Result Code: 200 Debugging information follows. Path: http://example.com/update.php?op=selection&token=rLvWG2eXJRGuLerwnxudgD4... StatusText: OK ResponseText: Fatal error: Call to undefined function file_type_save() in /home/example/public_html/sites/all/modules/media_youtube/media_youtube.install on line 172

Solution: http://drupal.org/node/1879136#comment-7103202

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

eigentor’s picture

I had this problem, too, when upgrading from Media 7.1.x to Media 7.2.x (to some unstable release first), but after simply running update.php again, 8 more updates (also the mentioned 7202) appear to have run cleanly.
After upgrading to alpha 2 after that, I even got the thumbnails file overview back again that was broken with the upgrade to the 2.x unstable.
So for the ones getting the ajax error maybe try running update.php a second time.

Apart from that:
Yay, go, media team!