I had a Node, which includes an Image field.

I wanted to Clone, but to change the image, as well as a few other details.

Got this as soon as I chose "remove" image :-

   *  Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'node_form' was given in drupal_retrieve_form() (line 771 of /home/likalco/public_html/core/includes/form.inc).
    * Notice: Undefined index: #node in comment_form_node_form_alter() (line 1190 of /home/likalco/public_html/core/modules/comment/comment.module).
    * Notice: Trying to get property of non-object in comment_form_node_form_alter() (line 1207 of /home/likalco/public_html/core/modules/comment/comment.module).
    * Notice: Undefined index: #node in menu_form_node_form_alter() (line 594 of /home/likalco/public_html/core/modules/menu/menu.module).
    * Notice: Trying to get property of non-object in menu_form_node_form_alter() (line 594 of /home/likalco/public_html/core/modules/menu/menu.module).
    * Notice: Undefined index: #node in menu_form_node_form_alter() (line 600 of /home/likalco/public_html/core/modules/menu/menu.module).
    * Notice: Trying to get property of non-object in menu_form_node_form_alter() (line 600 of /home/likalco/public_html/core/modules/menu/menu.module).
    * Notice: Undefined index: field_image in file_ajax_upload() (line 265 of /home/likalco/public_html/core/modules/file/file.module).
    * Notice: Undefined index: #suffix in file_ajax_upload() (line 274 of /home/likalco/public_html/core/modules/file/file.module).

I went ahead and saved anyway and the Node cloned, but with the original image.

I was then able to change the image by subsequent editing.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

supportPIC’s picture

subscribe

supportPIC’s picture

I think all is coming from the first warning, but I can't see why its gives an error since the callback function called is the same as in a usual node addition.

supportPIC’s picture

FileSize
4.59 KB
399 bytes

Seems quite similar to this issue: http://drupal.org/node/1105624

I patch it through another attached module that manage image field cloning. It is a quick/strange/ugly patch since the [files] attribute was in the $form[build_info][args] array and I added in the $form[build_info][files].

A recheck of this module (and of image management) from its creator would be welcomed. I am not sure it duplicate images properly.

Anonymous’s picture

Title: Can't change images » Same issue

Same issue here.

Also happens on clean drupal install.

Install with standard install profile. Cloning the default "article" content type and changing the image will throw this error.

Anybody a solution?

Anonymous’s picture

Title: Same issue » Ajax error when changing files in cloned node

Just a note: by settings the clone node settings in "admin/config/content/clone" to "Save as a new node then edit" we can prevent the error from happening.

wonder95’s picture

I was having this same issue with Ctools 7.x-1.0-rc1 (it was actually in Page Manager, per the link in #3). I updated to the latest 7.x-1.x-dev (2012-Jan-23), and the error has gone away.

joya’s picture

subscribe..

Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'node_form' not found or invalid function name in drupal_retrieve_form() (Zeile 787 von /home/....../includes/form.inc).

zareth’s picture

I had the same issue and fixed it by patching the module node clone.

Just added the line on top of the file clone.pages.inc:

require_once(drupal_get_path('module', 'node') . '/node.pages.inc');

PS : it seems that module_load_include doesn't work and I didn't find why)

tamerzg’s picture

Having same issue. Proposed change in #8 worked for me.

capellic’s picture

#8 Works.

ecksley’s picture

Yes, #8 works, thanks Zareth!

mstef’s picture

#8 works

cashwilliams’s picture

wrapped #8 into a patch

cashwilliams’s picture

Status: Active » Needs review
pwolanin’s picture

Status: Needs review » Postponed (maintainer needs more info)

This might be fixed by #1447974: Call to undefined function node_form_validate() - please verify

pwolanin’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)