Hello,

i created a new content type with an image upload field. Uploading works, but there is alwas following error when I click on the upload button:

warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'theme_imagefield_formatter_image_plain' was given in /var/www/html/includes/theme.inc on line 617.

When I try to open the node i get following error:

warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'theme_filefield_file' was given in /var/www/html/includes/theme.inc on line 617.

After reloading the page, the error disappears.

Does anyone have an idea what I could do?

Thanks alot

Comments

quicksketch’s picture

The first thing I'd check is that "theme_imagefield_formatter_image_plain" and "theme_filefield_file" functions still exist. Have you been doing some theming on your site? Perhaps these functions were deleted accidentally. I'd suggest downloading the 3.0 final versions of both FileField and ImageField and replace the current copies on your site (especially if you're using the RC1 version anyway).

spamwelle’s picture

Version: 6.x-3.0-rc1 » 6.x-3.1

Thanks for your answer. I made an update of all modules, but the error did not disappear.

Saving the CCK-Content-Type takes 15 seconds and following error repeats 10times:

warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'theme_imagefield_formatter_image_plain' was given in /var/www/html/includes/theme.inc on line 617.

I did alot of theming work. How can i check if the functions do still exist? Where could i have deleted theme?

Thanks alot

quicksketch’s picture

You should probably just replace your entire ImageField module directory with a fresh copy to make sure that these functions are still intact.

spamwelle’s picture

I deleted the folder, uploaded the new version and run update.php. Unfortenatly the error does not disappear. Maybe I should try to reinstall drupal? Would be alot of work.

quicksketch’s picture

There's definitely something wrong with your installation still, since that function very clearly exists and isn't a problem on fresh installs. I'd double-check that you don't have two copies of ImageField installed on your site. Drupal will find ANY .module file on your server if it's in modules, sites/all/modules, or sites/default/modules. My guess is that you have another copy of ImageField somewhere on the server that is missing or has corrupted files.

spamwelle’s picture

hmm. it seems to be the template. If I chose another template the failure is not there. Any ideas where I could check at first? Otherwise I will rebuild my template.

cakka’s picture

i am getting this error message when uploading image " Only web-standard images (jpg, gif, and png) are supported through the image widget. If needing to upload other types of images, change the widget to use a standard file upload. "

i have filled "gif jpg jpeg png bmp" in " Permitted upload file extensions: " field... but it still same..

any ideas for this ?

thanks

-----
Tech Blog - www.blog.ckcybers.com

cakka’s picture

oh i get it :D
sorry for my fool question :D

thanks

-----
Tech Blog - www.blog.ckcybers.com

leo pitt’s picture

I have been getting the same error:

"warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'theme_filefield_file' was given in /srv/mysite/public/htdocs/includes/theme.inc on line 617."

The way I'm triggering it seems slightly different:

I have a Block view which outputs a table. One of the fields in the view is a CCK ImageField.

When the format for the ImageField in my Block view is set to Generic Files, I get this error.

If I change the format for the ImageField to Image, the error stops occuring.

I've also noticed that the error does not happen when using my custom site theme, which has a custom filefield_file function defined in it, but the error does occur when using Garland.

I tried removing my custom filefield_file function and that does not make any difference. Made sure I was using the default, unaltered Views theme files and again, does not make any difference.

Cristobal Wetzig’s picture

subscribing

quicksketch’s picture

Status: Active » Closed (fixed)

Again, it sounds like the theme_filefield_file() function is literally missing from your installation. Reinstall FileField and ImageField modules. The theme_filefield_file() function should be in sites/all/modules/filefield/filefield_formatter.inc.