I noticed this today and have been searching through the queue with no luck in finding a similar issue being posted. I believe I have narrowed the problem down to the Page Manager (on the surface). When not installed, the image upload works perfectly. When Page Manager is installed the upload produces this error after ajax has completed:
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/name/public_html/site.com/public_html/includes/form.inc).
Notice: Undefined index: #node in book_form_node_form_alter() (line 392 of /home/name/public_html/site.com/public_html/modules/book/book.module).
Notice: Trying to get property of non-object in _book_add_form_elements() (line 507 of /home/name/public_html/site.com/public_html/modules/book/book.module).
Notice: Trying to get property of non-object in _book_add_form_elements() (line 507 of /home/name/public_html/site.com/public_html/modules/book/book.module).
Notice: Trying to get property of non-object in _book_add_form_elements() (line 507 of /home/name/public_html/site.com/public_html/modules/book/book.module).
Notice: Trying to get property of non-object in _book_add_form_elements() (line 507 of /home/name/public_html/site.com/public_html/modules/book/book.module).
Notice: Trying to get property of non-object in _book_add_form_elements() (line 507 of /home/name/public_html/site.com/public_html/modules/book/book.module).
Notice: Trying to get property of non-object in _book_add_form_elements() (line 507 of /home/name/public_html/site.com/public_html/modules/book/book.module).
Notice: Trying to get property of non-object in _book_add_form_elements() (line 507 of /home/name/public_html/site.com/public_html/modules/book/book.module).
Notice: Trying to get property of non-object in _book_add_form_elements() (line 507 of /home/name/public_html/site.com/public_html/modules/book/book.module).
Notice: Trying to get property of non-object in _book_add_form_elements() (line 507 of /home/name/public_html/site.com/public_html/modules/book/book.module).
Notice: Trying to get property of non-object in _book_add_form_elements() (line 511 of /home/name/public_html/site.com/public_html/modules/book/book.module).
Notice: Trying to get property of non-object in _book_add_form_elements() (line 517 of /home/name/public_html/site.com/public_html/modules/book/book.module).
Notice: Trying to get property of non-object in _book_add_form_elements() (line 518 of /home/name/public_html/site.com/public_html/modules/book/book.module).
Notice: Trying to get property of non-object in _book_add_form_elements() (line 539 of /home/name/public_html/site.com/public_html/modules/book/book.module).
Notice: Trying to get property of non-object in _book_add_form_elements() (line 548 of /home/name/public_html/site.com/public_html/modules/book/book.module).
Notice: Undefined index: #node in location_node_form_node_form_alter() (line 14 of /home/name/public_html/site.com/public_html/sites/all/modules/location/location_node.module).
Notice: Trying to get property of non-object in location_node_form_node_form_alter() (line 15 of /home/name/public_html/site.com/public_html/sites/all/modules/location/location_node.module).
Notice: Undefined index: #node in menu_form_node_form_alter() (line 594 of /home/name/public_html/site.com/public_html/modules/menu/menu.module).
Notice: Trying to get property of non-object in menu_form_node_form_alter() (line 594 of /home/name/public_html/site.com/public_html/modules/menu/menu.module).
Notice: Undefined index: #node in menu_form_node_form_alter() (line 600 of /home/name/public_html/site.com/public_html/modules/menu/menu.module).
Notice: Trying to get property of non-object in menu_form_node_form_alter() (line 600 of /home/name/public_html/site.com/public_html/modules/menu/menu.module).
Notice: Undefined index: #node in translation_form_node_form_alter() (line 128 of /home/name/public_html/site.com/public_html/modules/translation/translation.module).
Notice: Trying to get property of non-object in translation_form_node_form_alter() (line 128 of /home/name/public_html/site.com/public_html/modules/translation/translation.module).
Notice: Undefined index: type in xmlsitemap_node_form_node_form_alter() (line 141 of /home/name/public_html/site.com/public_html/sites/all/modules/xmlsitemap/xmlsitemap_node/xmlsitemap_node.module).
Notice: Undefined index: nid in xmlsitemap_node_form_node_form_alter() (line 141 of /home/name/public_html/site.com/public_html/sites/all/modules/xmlsitemap/xmlsitemap_node/xmlsitemap_node.module).
Notice: Undefined index: field_gallery in file_ajax_upload() (line 265 of /home/name/public_html/site.com/public_html/modules/file/file.module).
Notice: Undefined index: #suffix in file_ajax_upload() (line 274 of /home/name/public_html/site.com/public_html/modules/file/file.module).
The images are being uploaded still, but nothing is attached to the node if the node is saved. The image upload field is overwritten by this error when the upload is clicked.
Please excuse the large blockquote, as I'm sure you don't need quite a few of those references. I didn't want to leave out anything though.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 1105624-fix-include-file-node-edit-form.patch | 1016 bytes | ygerasimov |
Comments
Comment #1
mefisto75 commentedI have the same issue. Just unabled Page manager and could upload images.
I previously posted an issue at Drupal core list.
http://drupal.org/node/686938#comment-4271432
Comment #2
mefisto75 commentedProblem is that I've already created a bunch of pages using Page manager. Can't disable it.
Comment #3
ygerasimov commentedI have a bit different issue but maybe related to this one. I have overriden edit form with panel. But still on upload or remove file in ajax widget I get errors similar to above.
Comment #4
ygerasimov commentedTo reproduce the bug:
1. Enable Page manager page /node/%node/edit
2. Try to add file to any filefield with ajax
The problem is when form is build required file to build the form (node.pages.inc) is not included properly.
Please review attached patch that fixes this issue.
Comment #5
kbm065 commentedThe patch seems to work for me! Thanks!
Comment #6
ygerasimov commentedThank you for testing. Moving this issue to reviewed.
Comment #7
floleft commentedI have tested the patch and I am receiving the error:
"The file test.jpg could not be saved. An unknown error has occurred."
The log message:
"The file upload failed."
Comment #8
ygerasimov commented@floleft please confirm that upload works good if you disable page manager.
Comment #9
floleft commentedApologies. This latest issue may be a result of something I did to my server yesterday. I'm resolving the issue and will retest the patch.
Comment #10
floleft commentedThe patch did fix the problem. My latest issue was with a conflict from imagemagick. Please ignore my post #7, the patch is working for me as well.
Comment #11
merlinofchaos commentedThis was also needed for both node_add_form.inc and node_edit_form.inc so I extended it to both, committed and pushed.
Comment #12
floleft commentedI'm having a problem with image upload on the node add/edit panel override page. I'm receiving an ajax error message on upload. After clicking ok, the file path is still in the field and it doesn't look like anything was uploaded. If I scroll down and save the post, the file was uploaded. So, it seems that ajax just doesn't know what to do after the upload occurs, but the file is being uploaded to the server and added to the DB.
A big chunk is shown after the status text with snippets of lots of different javascript that is occurring on the page. I'm hesitant on opening a new bug post if this is related.
Comment #13
floleft commentedI updated to the latest DEV (May 5th) version of ctools, panels and views and this issue is still occurring. I updated the inc files with the patch once again it's working fine. Just updating this issue in case this patch was forgotten or others didn't know.
Comment #14
merlinofchaos commentedWith that kind of failure, can you please check your apache/php/watchdog logs and see if there is a PHP error?
Comment #15
merlinofchaos commentedThis patch did get committed: http://drupalcode.org/project/ctools.git/commitdiff/3e96b7e99d2965e955a1...
So somehow you may not actually have the latest -dev if you were able to apply it again.
Comment #16
floleft commentedI reapplied the latest DEV and it was there. Not sure what I did there.
@ #12: It looks like that issue only occurs when using Opera. It may be a core issue. I haven't debugged it entirely.
Comment #17
tjtj commentedAfter I apply this patch, the uploads work, but when I preview the page, I get:
Comment #18
merlinofchaos commented#17 would be a separate issue.
Comment #20
yseki commentedYou can do that to return a form to add a node