Pretty much the same issue as in #1796930: update.php Error: Call to undefined function file_displays_load(), but with next update. Update seems to fail. I'll post a patch shortly.

Comments

xjsjag’s picture

We're still having this issue with update 7202, but there doesn't seem to be any other information about it, other than the link you posted to the closed issue. Is a patch still in the works?

Jeff Burnz’s picture

I get an error when running 7202 also, undefined function file_type_save()

An AJAX HTTP error occurred. HTTP Result Code: 200 Debugging information follows. Path: http://brady:8888/update.php?op=selection&token=hO2Pihl2LOwNgiJtRedVBTbjAHMnOi3lj-fGzOTXjWw&id=7&op=do StatusText: OK ResponseText: Fatal error: Call to undefined function file_type_save() in ~/sites/all/modules/media_youtube/media_youtube.install on line 170

aaron’s picture

Status: Active » Needs review
StatusFileSize
new584 bytes

Here you go.

aaron’s picture

Status: Needs review » Fixed

I have committed this patch.

anavarre’s picture

Status: Fixed » Active

Unfortunately, updating to RC2 - while the patch is indeed there - still throws this error.

EventHorizonRT’s picture

I resolved modifying from:

file_type_save($video_type);
file_save($video_type);

in my case file_type_save was the problem.
I hope that my contribution has been helpful

Regards

thinkdrupal’s picture

#6 patch resolved the issue for me. Thanks.

vegantriathlete’s picture

I don't think that #6 *solves* the problem at all. file_save is a function defined by Drupal core inside of includes/file.inc. file_type_save is defined by the 7.x-2.x branch of the stand alone file_entity project.

What version of Media are you using?
Are you using the file_entity stand alone project?

It appears that if you are using the 7.x-2.x branch of Media: YouTube you also need to be using the 7.x-2.x branches of Media and File Entity

phai’s picture

Yes, I solved updating these three modules:
- Media to 7.x-2.0-unstable7
- File entity to 7.x-2.0-unstable7
- Media: YouTube to 7.x-2.0-rc2

(I hope they becomes stable asap... :D )

Thanks

groovedork’s picture

I get this perhaps related error:

An AJAX HTTP error occurred. HTTP Result Code: 200 Debugging information follows. Path: http://DOMAIN/update.php?op=selection&token=YecrxFRt27gAPQW_0EfO6HAFpKlH... StatusText: OK ResponseText: Fatal error: Call to undefined function file_type_save() in /home/USERS/domains/DOMAIN/public_html/sites/all/modules/media_youtube/media_youtube.install on line 172

On updating a recently upgraded (6->7) site.

media_youtube 7.x-2.0-rc2
Media 1.0 (most recent version)

I don't want to update my media and file-entity modules to the 2.0 version as they are still unstable. How do I fix this situation now? I have a database backup of just before the update. Could I put that back and also place the older version of the module in the right directory?

vegantriathlete’s picture

@groovedork

You need to use Media: YouTube 7.x-1.0-beta3

Gaelan’s picture

In that case, the info file should read:

dependencies[] = media (2.x)
damienmckenna’s picture

Status: Active » Needs review
StatusFileSize
new393 bytes

@gaelan: You mean like this?

This should probably have something similar added to the v7.x-1.x branch to indicate compatibility with Media 7.x-1.x.

Gaelan’s picture

Yup. If Media: YouTube 1.x won't work with Media 2.x, then we would want to do this to 1.x too.

taonac’s picture

#6 fixed it.
changed line 172 from file_type_save($video_type);
to file_save($video_type);
Thanks SonPeo

SgtHP’s picture

#6 fixed it
it's work. thx.

vegantriathlete’s picture

@taonac & @SgtHP:

Read my comment in #8! #6 does NOT fix it. It just points things to a totally different function (that is defined in core). Look at the comments in the thread. You need to either be on all the 2.x versions or all the 1.x versions. You should not mix and match.

Infoloko’s picture

Another update error:

An AJAX HTTP error occurred. HTTP Result Code: 200 Debugging information follows. Path: http://xxxxxxx/update.php?op=selection&token=IWCuhIsPUba7Ol_3qnVtCIaLGhj... StatusText: OK ResponseText: Fatal error: Call to undefined function file_type_save() in xxxxxxx\sites\all\modules\media_youtube\media_youtube.install on line 172

taonac’s picture

@ vegantriathlete

OK i get what you're saying. So does pointing to a different function( #6) have any negative implications. Does it potentially slow down performance or something we should keep a look out for? Thanks for rectifying by the way.

vegantriathlete’s picture

@taonac: Pointing to a different function means that whatever was *supposed* to be happening by calling the function in the .install file is not happening. I can't say exactly what effect this will have as I didn't dig through the code or run any experiments. I chose to resolve the issue by using all the 7.x-1.x releases. This means that I am NOT using the stand alone file_entity project; I am using the one that is bundled with media. I am using only the 7.x-1.x releases of media and media_youtube.

aiphes’s picture

idem here for an upgrade drupal core version :

media_youtube module :
  7202 -  Update Media YouTube files to the new video file_entity type.

trying 2.0 dev version and same issue

JRopers’s picture

#6 worked well for me...

Slovak’s picture

+1 for #6

aiphes’s picture

#6 : where do i modify theses lines ?

Slovak’s picture

The error states:

Call to undefined function file_type_save() in /path/to/your/drupal/modules/media_youtube/media_youtube.install, line 172

So you need to locate media_youtube.install and edit line 172.

Jeff Burnz’s picture

I actually just commented out the entire update in the install file, rugged I know, but it was preventing other updates from firing on one particular site, no choice, had to disable this.

gmcmahon’s picture

#6 worked for me

nathaniel’s picture

dave reid’s picture

Status: Needs review » Closed (duplicate)
mimmus’s picture

I had the same problem:
#6 worked for me too

momfer’s picture

same problem:
#6 worked for me too

brian.sanchez’s picture

#6 fixed it.
changed line 172 from file_type_save($video_type);
to file_save($video_type);

this worked for me!, thank you

mynameiscorey’s picture

To everyone who has replied #6 worked for me! Hooray! You are substituting a function for a completely unrelated one. Sure the fatal error is fixed, but you have no idea how differently this function is writing data to you database than the intended function would. It's like swapping 'print $var;' for 'print_r($var)'. They have similar names but achieve completely different things.

mynameiscorey’s picture

FWIW, installing file_entity 7.x-2.0-unstable7 allows me to run update.php and successfully execute update #7202 without a fatal error. I understand people are hesitant to use a module with 'unstable' in the release name but at least the code in the update hooks will achieve it's intended result, sans hacks.

dave reid’s picture

A reminder for everyone that this has been fixed already by simply upgrading to Media: Youtube 7.x-2.x-dev with #1949520: Remove media_youtube_update_7202() and media_youtube_file_default_types_alter(). You do not need the patch in #6.

BChandran’s picture

I was getting the following error but #6 fixed it. Thank you SonPeo:

An AJAX HTTP error occurred. HTTP Result Code: 200 Debugging information follows. Path: .../update.php?op=selection&token=cjZwCZTBwo6FedDAvXFhyQk9nGnCF1IE2qLzQTxTUeg&id=503&op=do StatusText: parsererror ResponseText: Fatal error: Call to undefined function file_type_save() in .../public_html/sites/all/modules/media_youtube/media_youtube.install on line 172

anavarre’s picture

@BChandran - This issue has been obsoleted per #29 and #35. Note that Media: YouTube RC3 is shipping with the fix.

shahidbscs’s picture

Issue summary: View changes

update file_entity & this resolve my issue.