Call to undefined function drupal_submit_form() when user submits a comment
corsix - March 31, 2008 - 16:29
| Project: | Akismet |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
After enabling askimet, when trying to post a comment, I get the following:
Fatal error: Call to undefined function drupal_submit_form() in /home/corsix/public_html/modules/akismet/akismet.module on line 707
#1
drupal_submit_form()doesn't exist anymore in Drupal 6.x or higher (see the documentation page, where the tab for Drupal 6.x is missing).Strangely enough, that change is not documented in the "Converting 5.x modules to 6.x" page.
#2
Just a confirmation - I am seeing this bug as well.
#3
subscribe.
I'm seeing it too.
#4
Does anybody know how to fix this problem? I can't see any information on drupal.org talking about how to handle the conversion to Drupal 6,
here http://drupal.org/node/114774#formapi3
or here http://drupal.org/node/144132
Are there any other resources describing how one goes about updating a drupal 5 module, addressing this particular problem?
#5
updating title.
#6
Maybe
drupal_execute()can be used in this case.The example in the documentation is the following:
<?php// register a new user
$form_state = array();
$form_state['values']['name'] = 'robo-user';
$form_state['values']['mail'] = 'robouser@example.com';
$form_state['values']['pass'] = 'password';
$form_state['values']['op'] = t('Create new account');
drupal_execute('user_register', $form_state);
?>
#7
subscribe.
I hope that does what I think it does!
#8
For what I can understand, it permits to submit some values to a form from a Drupal module.
Actually, I don't understand why there would be two different functions in Drupal 5 which make almost the same thing. The example, anyway, is clear.
#9
marked #268149: Blank white page after comment submission as a duplicate
#10
subscribe: really having a problem with this and have had to turn off Akismet as it is confusing commenters.
#11
Just exchanging drupal_submit_form for drupal_execute seems to work.
#12
Would anybody submit a patch to fix the issue?
#13
subscribing
#14
Like others I'd love to see a fix for this so I've gone looking about for a solution, despite having very little knowledge, so please forgive me if I am stating the blatantly obvious.
Have you tried using comment_form_submit() instead? It seems to have the elements you're after.
I'd really hate if we got stuck on this and believe that if we can overcome it we can push on and get this module Drupal 6-ified.
#15
It could be the right function to use.
There is just a question that needs an answer: is the form redirection made from that function the desired one?
#16
Please, remove my last comment from your mind. :-)
comment_form_submit()is supposed to be called directly from the core routines; plus, it requires you prepare the arguments it need, and one of them is the parameter&$form_state(I don't know if we know exactly how it should be set).Watching at that function, anyway, we can see what it does, and use that code to do the same. I actually don't understand a thing: is necessary to imitate the submission of the form data? Would not it be possible to save the data into the comments table? Please, accept my apologies if the question seems silly.
#17
I'm also getting this bug. Initially I tried posting a comment as an anonymous user; I got the fatal error referenced above and my comment did not post. Then I logged in as an authenticated user and tried posting a comment again; I got the fatal error again but the comment did post. However, when I log in as an administrator and try to unpublish that comment, I get a "Page Not Found."
#18
To be honest, this is just one of the many problems that exist with this module under drupal 6. It's just sad that there seems to be a complete lack of movement. I wish I had the knowledge to be able to give this a nudge or two.
#19
Subscribing. I too have had to disable this module since its broken behaviour is confusing people.
#20
Same here,
Module disabled. Anyone have a suggestion for a replacement? Preferably one maintained?
#21
You can check Mollom.
#22
subscribing
The module worked great under 5.x but hasn't worked at all for me in 6.x. I have it disabled for now.
#23
I forgot to say who is the maintainer for Mollom, but you can read his name on the footer of every page here. :-)
#24
same issue here.
#25
Changing the title: it's useless to say "in Drupal 6" when the issue is reported for the version 6.x-1.x-dev of the module.
#26
Great advice. After enabling it it's been catching spam left and right.
#27
Same problem.
A temporal solution is a exchange "drupal_submit_form" for "drupal_execute" on a "akismet.module", but apears a little new problem.
#28
Confiirming - the same problem. I have turned Akismet module off.
#29
Same problem here, subscribing.
#30
subscribing
#31
subscribing
#32
This module hasn't been touched in nearly 6 months so unless someone is going to adopt it there is no point in subscribing. I recommend Mollom instead.
#33
switched to mollom, but mollom seems to have capacity problems. mollom.com is done: to many connections :(
#34
same problem
#35
same problem on one of my websites. For some reason it works on the other website despite running the same Drupal version.
#36
subscribing
#37
Just confirming that I'm seeing the same and disabled.