Image upload plugin fails to upload an image and I receive the following error:

call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'yui_editor_image_upload' was given in ... /includes/menu.inc on line 348.

I worked around the error by removing all entries from the Paths field of the YUI Editor profile.

Comments

lil-1’s picture

Hi,
I got the same after giving anonymus user the YUI editor access and image upload permissions.
Paths entries removing helps but how else to exclude YUI editor from apearing on block add/edit pages for example?

codeseek’s picture

I haven't had to edit or add blocks since running into the error. I suppose you could disable/enable YUI Editor when working with blocks (a pain), or you could try enabling the Code plugin for the YUI Editor and use that when editing blocks. I used it when editing a node and it seemed to work.

jdanthinne’s picture

Priority: Normal » Critical

Got the same error.
Don't understand what it has to do with menu.inc by the way.
Very annoying.

drubb’s picture

I've got this error, too. And for me it has nothing to do with defined path entries or field ids, but with a simple bug in file handling on certain server constellations:

Images get uploaded, but after upload they have the wrong file attribute "600" instead of "644", wich leaves them unaccessible and forces this error. You should just include a little patch in YUIE's image_upload_inc:

  ...
  $response->status = 'UPLOADED';
  $response->image_url = $file->filepath;

  // Set it to permanent so it doesn't get wiped on the next cron run!
  file_set_status($file, FILE_STATUS_PERMANENT);
  chmod($file->filepath, 0644); // BUGFIX: force the file to be readable.
 
  print drupal_to_js($response);
  exit;
  ...

Don't know whether this is a drupal, php or apache bug, but I've seen this fix in other modules already.

Regards,
Boris

deshilachado’s picture

subscribing,
for now i just removed everything from the path entries
(i used the path for speed reasons: #232286: It slows down the whole site?)

mecano’s picture

possible fix here : http://drupal.org/node/320517

alarcombe’s picture

Status: Active » Fixed

This is fixed for me by adding

yui_editor/image_upload

to the Paths setting in the profiles that you wish to use YUI's image uploading.

Cheers,

A

Marcus Aurelius’s picture

Thank you so much! Needs to fixed in the next version right?!

Status: Fixed » Closed (fixed)

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