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
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

kiamlaluno - May 27, 2008 - 17:25

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

domesticat - June 18, 2008 - 02:51

Just a confirmation - I am seeing this bug as well.

#3

grateful_drupal_user - June 29, 2008 - 18:18

subscribe.

I'm seeing it too.

#4

grateful_drupal_user - June 29, 2008 - 20:10
Title:Call to undefined function drupal_submit_form» Call to undefined function drupal_submit_form in Drupal 6
Priority:normal» critical

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

grateful_drupal_user - June 29, 2008 - 20:12
Title:Call to undefined function drupal_submit_form in Drupal 6» Call to undefined function drupal_submit_form in Drupal 6 when user submits a comment

updating title.

#6

kiamlaluno - June 29, 2008 - 21:00

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

alastair - July 4, 2008 - 20:49

subscribe.

I hope that does what I think it does!

#8

kiamlaluno - July 4, 2008 - 22:00

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

drewish - July 13, 2008 - 07:54

#10

MorganParker - July 15, 2008 - 06:34

subscribe: really having a problem with this and have had to turn off Akismet as it is confusing commenters.

#11

Daniel S. Jackson - July 20, 2008 - 03:42

Just exchanging drupal_submit_form for drupal_execute seems to work.

#12

kiamlaluno - July 20, 2008 - 07:17

Would anybody submit a patch to fix the issue?

#13

mrfelton - July 27, 2008 - 11:05

subscribing

#14

harrisben - July 29, 2008 - 07:46

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

kiamlaluno - July 29, 2008 - 15:58

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

kiamlaluno - July 29, 2008 - 16:04

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

juniperphoenix - July 30, 2008 - 17:19

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

harrisben - August 1, 2008 - 16:27

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

MikalH - August 8, 2008 - 13:53

Subscribing. I too have had to disable this module since its broken behaviour is confusing people.

#20

tcblack - August 25, 2008 - 17:19

Same here,

Module disabled. Anyone have a suggestion for a replacement? Preferably one maintained?

#21

kiamlaluno - August 26, 2008 - 03:34

You can check Mollom.

#22

alpinejag - August 27, 2008 - 15:20

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

kiamlaluno - August 27, 2008 - 16:00

I forgot to say who is the maintainer for Mollom, but you can read his name on the footer of every page here. :-)

#24

snicers - August 28, 2008 - 19:33

same issue here.

#25

kiamlaluno - August 30, 2008 - 11:28
Title:Call to undefined function drupal_submit_form in Drupal 6 when user submits a comment» Call to undefined function drupal_submit_form() when user submits a comment

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

tcblack - August 31, 2008 - 03:12

Great advice. After enabling it it's been catching spam left and right.

#27

tronick - September 2, 2008 - 15:47

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

Konstantin Boyandin - September 9, 2008 - 06:14

Confiirming - the same problem. I have turned Akismet module off.

#29

Poromenos - September 9, 2008 - 08:57

Same problem here, subscribing.

#30

two40 - December 17, 2008 - 12:10

subscribing

#31

arena - January 28, 2009 - 00:42

subscribing

#32

harrisben - January 28, 2009 - 09:52

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

snicers - February 5, 2009 - 23:15

switched to mollom, but mollom seems to have capacity problems. mollom.com is done: to many connections :(

#34

ionmedia - April 6, 2009 - 17:47

same problem

#35

dailypress - August 17, 2009 - 17:22

same problem on one of my websites. For some reason it works on the other website despite running the same Drupal version.

#36

saturnin - September 9, 2009 - 16:01

subscribing

#37

jibbajabba - November 6, 2009 - 17:59

Just confirming that I'm seeing the same and disabled.

 
 

Drupal is a registered trademark of Dries Buytaert.