Here's the error:
Fatal error: Call to undefined function _filefield_source_attach_file_path_validate() in /home/xxx/xxx/includes/form.inc on line 1410
This is on a Drupal 7.20 installation.
We could replicate the error by creating a new content type and adding only an image field. None of the options under "enabled sources" need to be checked. On hitting the save settings button on the field properties form, the above error is produced.
We found that this error would NOT be produced if the field type was a "file".
This led us to consider what other modules might be hooked into the image data type. We uninstalled a module called "Lightbox 2". The symptom disappeared. We replaced the "Lightbox 2" module with "Colorbox". All was well. Until...
We installed the FlexSlider Module. The same symptoms as before reappeared.
I have another Drupal 7.20 installation with FileField Sources, Colorbox, and FlexSlider which works fine.
Another notable module installed on the problem install is Ubercart.
I know that the recent 7.20/7.21 release is introducing changes to the image module, I wonder if this has any bearing on this situation.
Comment | File | Size | Author |
---|---|---|---|
#16 | hook_filefield_source_info-1936836-10.patch | 2.12 KB | Softwar |
#4 | filefield_sources_form_include-1936836.patch | 6.32 KB | quicksketch |
Comments
Comment #1
quicksketchThanks for the report. I think this problem is probably not related to any of the most recent changes, but different versions of Drupal and different installations of modules may be the reason why this is only showing up on some of your sites (and I've never seen it at all). Sometimes when Drupal submits and validates a form, it doesn't rebuild the whole form. Since the build function is what loads the sources/attach.inc file (which contains the _filefield_source_attach_file_path_validate() function), if the build function gets skipped and Drupal uses a cached version, the error occurs that you're seeing.
There's a FormAPI property or $form_state key for making sure all the necessary files are loaded, but I can't recall it at the moment. Something like $form_state['build_files'] or something. We need to set that property to ensure all the necessary sub-files are included on validation/submit.
Comment #2
collier.matthew CreditAttribution: collier.matthew commentedIntermittent problems after my initial post. The most obvious difference between the site that was working and the one that was not was the Ubercart module.
Immediately after disabling the Ubercart module(s), all the symptoms we were observing at that moment disappeared.
I'll report back as the situation develops.
Comment #3
collier.matthew CreditAttribution: collier.matthew commentedThis issue has not reappeared since Ubercart was disabled.
Comment #4
quicksketchI've committed this patch which makes FileField Sources utilize form_load_include() for each include when displaying a settings or field form for that source. Since I never encountered this problem myself, I can't confirm that it would solve the problem, but logically, it seems that this should do the trick. Please let me know if it seems this problem is fixed (or not) in the 1.8 release when it comes out.
Comment #6
Ram_doss CreditAttribution: Ram_doss commentedIf i try to use this remote url on a image field, while trying to save that image field i am getting this error.
Fatal error: Call to undefined function _filefield_source_attach_file_path_validate() includes/form.inc on line 1410
What should i do?
Comment #7
carolineboivin CreditAttribution: carolineboivin commentedI get the same error message when trying to save an image field : Fatal error: Call to undefined function _filefield_source_attach_file_path_validate() in /xx/xx/includes/form.inc on line 1411. Running Drupal 7.23
Comment #8
rakesh.nimje84@gmail.com CreditAttribution: rakesh.nimje84@gmail.com commentedI am also facing the same issue running Drupal 7.26. Any help would be appreciated in advance.
Comment #9
AnybodySame problem here with the latest Drupal version.
Comment #10
Softwar CreditAttribution: Softwar commentedHello,
I found a solution for this issue.
The solution is that the name of directory for .inc files isn't a good name. For each .inc files into "sources", you must change hook_filefield_source_info() like that, for example :
The commit that introduce this problem is http://cgit.drupalcode.org/filefield_sources/commit/?id=fe1016a
I don't understand why the name of this directory has been changed?
Best regards.
Comment #11
wranvaud CreditAttribution: wranvaud commentedThx Softwar, that seems to be it!
Comment #12
davej CreditAttribution: davej commented+1 for #10, which fixes a clear error in http://cgit.drupalcode.org/filefield_sources/commit/?id=fe1016a
Would it be possible to get this committed, please?
Regards,
Dave
Comment #13
klokie CreditAttribution: klokie commentedSame here. Looks to me like maybe the fix was never committed to 7.x-1.9. Can we get a new release please?
Comment #14
Plazik CreditAttribution: Plazik commentedDisabling and enabling module helped me.
Comment #15
Softwar CreditAttribution: Softwar commentedComment #16
Softwar CreditAttribution: Softwar commentedHello,
I've added a patch because the changements wouldn't commit by the principal mainteners.
It's a solution in wait that the module has been modify.
Enjoy :)
Comment #17
DamienMcKennaLooks reasonable.
Comment #19
profak CreditAttribution: profak as a volunteer commentedThanks everyone!
Patch #16 applied to 7.x-1.x.
Comment #20
profak CreditAttribution: profak as a volunteer commentedIn 7.x-1.10.