Trying to upload a file using the upload button in a local action to create a node fails with the following error:
* 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() (line 771 of /home/quickstart/websites/namakadance.dev/includes/form.inc).
* Notice: Undefined index: #node in comment_form_node_form_alter() (line 1190 of /home/quickstart/websites/namakadance.dev/modules/comment/comment.module).
* Notice: Trying to get property of non-object in comment_form_node_form_alter() (line 1207 of /home/quickstart/websites/namakadance.dev/modules/comment/comment.module).
* Notice: Undefined index: #node in menu_form_node_form_alter() (line 594 of /home/quickstart/websites/namakadance.dev/modules/menu/menu.module).
* Notice: Trying to get property of non-object in menu_form_node_form_alter() (line 594 of /home/quickstart/websites/namakadance.dev/modules/menu/menu.module).
* Notice: Undefined index: #node in menu_form_node_form_alter() (line 600 of /home/quickstart/websites/namakadance.dev/modules/menu/menu.module).
* Notice: Trying to get property of non-object in menu_form_node_form_alter() (line 600 of /home/quickstart/websites/namakadance.dev/modules/menu/menu.module).
* Notice: Undefined index: field_mp3_file in file_ajax_upload() (line 265 of /home/quickstart/websites/namakadance.dev/modules/file/file.module).
* Notice: Undefined index: #suffix in file_ajax_upload() (line 274 of /home/quickstart/websites/namakadance.dev/modules/file/file.module).
Steps to reproduce:
Create a new Drupal 7 Web site.
Download views, ctools and context_admin
Enable ctools, page_manager, views, views_ui and context_admin
Create a new content type.
Add a File Field
Test that adding adding a node and using the upload button works.
Add Content
Choose the content type you created
Browse for a file and click upload. (this works)
Create a new page view of the content type you created.
Create a new page with a local action to create the node you just created.
Structure/Pages/Add custom page
Set up the page as a local action to create node.
When using this new action the file upload button will fail with the above message.
I am pretty new to PHP and Drupal so I was not able to figure out how to patch this to make it work, but seems to be a pretty big bug. Hope someone knows better than me how to fix it.
BTW I found that ctools had a similar bug. https://drupal.org/node/1105624
It appears they have fixed that bug, but it did not give me any clues on how to fix it in Context admin. For now I will not be able to use the Create Node functionality if the content type has a file upload field.
I hope I provided enough information because I really like this module.
Comment | File | Size | Author |
---|---|---|---|
#19 | field_ajax_node_edit.patch | 2.38 KB | mh86 |
#16 | demo.zip | 2.01 MB | alexdezark |
#11 | field-ajax.patch | 2.52 KB | EclipseGc |
Comments
Comment #1
EclipseGc CreditAttribution: EclipseGc commentedYour docs look pretty good, I'll see if I can replicate this shortly. Definitely want to fix that.
Comment #2
markduce CreditAttribution: markduce commentedDid you get anywhere with this?
I'd be interested to hear the outcome.
Comment #3
markduce CreditAttribution: markduce commentedIf you upgrade to the latest version of Ctools this problem is fixed
Comment #4
g76 CreditAttribution: g76 commentedstill happening with latest Ctools 7.x-1.x-dev (2011-Jul-28), fresh install
just wanted to say I am so excited about ca, as a solo site builder, life will be so much easier. thank you for taking the time to create this and open things up to non-coders, it is very much appreciated.
edit:
error message
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 772 of /data/all/011/drupal-7.4-dev/includes/form.inc).
Comment #5
g76 CreditAttribution: g76 commentedhope this is okay, changing to active and against the dev version.
Comment #6
dboulet CreditAttribution: dboulet commentedYup, same problem here with ctools rc1.
Comment #7
EclipseGc CreditAttribution: EclipseGc commentedOK, sorry to see this isn't resolved. Been a bit swamped with work, but I'm deploying a site this will matter for personally here semi-soon, so I will be working on this. This probably has something to do with ajax callbacks and the fact that my plugin is manually loading the node_form. I have some ideas at least, thanks for all the docs on this.
Comment #8
g76 CreditAttribution: g76 commentedthanks! know the feeling with being swamped:). I am not a coder, but if you need things tested I would be more than happy to do that. again, thank you for all the hard work and the vision.
Comment #9
mh86 CreditAttribution: mh86 commentedSubscribing.
Experiencing the same problem.
Comment #10
jpfeifer CreditAttribution: jpfeifer commentedsubscribe
Comment #11
EclipseGc CreditAttribution: EclipseGc commentedOK, so I'm not happy that I had to do it this way, but I made the most of it. I think this will open up some doors in the future. Should be in newest dev, this is what the patch looks like:
Comment #12
EclipseGc CreditAttribution: EclipseGc commentedAdded a few more fixes, pretty happy with it at this point.
Comment #14
alexdezark CreditAttribution: alexdezark commentedHi,
I'm using context_admin 7.x-1.1 with Drupal 7.8
I still have the same problem when I'm trying to upload a file in a Context admin.
If a node is created without nothing in the file input and then I try to update the node and upload a file I have the same error message.
There's no problem if I upload the file when I create the node, but I can't upload a file in an update operation.
the file is uploaded to the directory, some rows are created in the database but the error apears and the file (it's link) doesn't apears anywhere.
do I have to patch this version of context_admin ?
Comment #15
EclipseGc CreditAttribution: EclipseGc commentedI think this is probably a different issue. Are you using context_admin to display node edits?
Comment #16
alexdezark CreditAttribution: alexdezark commentedHi and thanks a lot for your answer,
Yes I'm using context_admin to display node edits.
I've just made a short swf video demo (attachement) to show you the process :
How the link to node edit is generated, a short overview of the page manager and how the bug (??) apears.
Comment #17
EclipseGc CreditAttribution: EclipseGc commentedYeah I haven't watched your demo yet (don't know if I will cause I'm pretty sure I know the problem here).
I will have to see if the node edit can do this, I'm positive I didn't test it, so I think you've just found a whole in my manual testing. I will try to look at this soonish.
Comment #18
alexdezark CreditAttribution: alexdezark commentedWell, at last I wrote my own module.
I just needed to hide some fields for the final user, so I did it with some jQuery.
Comment #19
mh86 CreditAttribution: mh86 commentedAttached a patch that fixes the node edit form as well (the same way as it was fixed in #11)
Comment #20
zambrey CreditAttribution: zambrey commentedPatch #19 fixed issue with file upload, thanks.
Comment #21
ron_s CreditAttribution: ron_s commentedThis same problem exists when trying to create a taxonomy term that includes a Ajax-based file upload.
Requires a different solution though, since the approach to creating the term form in context_admin is different.