PHP Fatal error: Call to undefined function video_upload_initialize_provider() in sites/all/modules/contrib/video_upload/video_upload.install on line 71
although it is defined in the following places, it is not recognized during install
grep -in "video_upload_init" *
video_upload.install:71: video_upload_initialize_provider();
video_upload.module:40:function video_upload_initialize_provider() {
video_upload.module:681: video_upload_initialize_provider();
video_upload.module:697: video_upload_initialize_provider();
video_upload.module:708: video_upload_initialize_provider();
video_upload.module~:40:function video_upload_initialize_provider() {
video_upload.module~:591: video_upload_initialize_provider();
video_upload.module~:607: video_upload_initialize_provider();
video_upload.module~:618: video_upload_initialize_provider();
video_upload.theme.inc:24: video_upload_initialize_provider();
video_upload.theme.inc:124: video_upload_initialize_provider();
video_upload_widget.inc:27: video_upload_initialize_provider();
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | 610546.patch | 2.92 KB | bojanz |
| #3 | video_upload_profile_fixes.patch | 2.84 KB | axolx |
Comments
Comment #1
jhedstromIn the install hook, immediately prior to calling that function is this line:
so I'm not sure how this error is occuring.
Comment #2
manarth commentedThe problem occurs if the module is installed as part of an install profile.
This is because the system table doesn't yet exist, so drupal can't lookup module directories (e.g. drupal_load() or drupal_get_path()).
Comment #3
axolx commentedI've ran into the same issue. As manarth pointed out, modules can't use drupal_get_path() in functions that are called during profile installation. That includes, but is not limited, to hook_requirements.
The attached patch is a first shot at making the module compatible for use in install profiles. Most places where it drops drupal_get_path are safe except for:
which assumes that both video_upload and cck and are in the same modules directory. This should be true in most cases, but still not ideal...
Comment #4
axolx commentedComment #5
jhedstromUnfortunately, there's no way to assume that CCK is always in the same directory. Multisite installs commonly have modules in different directories. Acquia Drupal will also have CCK in a different directory.
Comment #6
axolx commentedjquery_ui is dealing with a similar issue: http://drupal.org/node/325831
Comment #7
jhedstromAs far as I can tell, the __FILE__ approach should work fine. My comment in #5 is only relevant if this line stays as is:
I think it can safely be removed entirely, as the purpose is for checking during updates, and video_upload_install() already does this. If you reroll the patch in #3 to remove this, I'll try to get this in soon.
Comment #8
bojanz commentedRetitling.
Comment #9
bojanz commentedHere's an updated patch, as jhedstrom requested. Please test.
Comment #10
jhedstromThis patch works for me.