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
CommentFileSizeAuthor
#38 akismet.patch4.67 KBweb.net
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

apaderno’s picture

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.

domesticat’s picture

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

mcurry’s picture

subscribe.

I'm seeing it too.

mcurry’s picture

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?

mcurry’s picture

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.

apaderno’s picture

Maybe drupal_execute() can be used in this case.
The example in the documentation is the following:

// 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);
alastair’s picture

subscribe.

I hope that does what I think it does!

apaderno’s picture

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.

drewish’s picture

MorganParker’s picture

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

Daniel S. Jackson’s picture

Just exchanging drupal_submit_form for drupal_execute seems to work.

apaderno’s picture

Would anybody submit a patch to fix the issue?

mrfelton’s picture

subscribing

harrisben’s picture

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.

apaderno’s picture

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?

apaderno’s picture

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.

juniperphoenix’s picture

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

harrisben’s picture

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.

mhutch’s picture

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

tcblack’s picture

Same here,

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

apaderno’s picture

You can check Mollom.

alpinejag’s picture

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.

apaderno’s picture

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

Nchase’s picture

same issue here.

apaderno’s picture

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.

tcblack’s picture

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

tronick’s picture

Same problem.

A temporal solution is a exchange "drupal_submit_form" for "drupal_execute" on a "akismet.module", but apears a little new problem.

Konstantin Boyandin’s picture

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

Poromenos’s picture

Same problem here, subscribing.

two40’s picture

subscribing

arena’s picture

subscribing

harrisben’s picture

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.

Nchase’s picture

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

ionmedia’s picture

same problem

dailypress’s picture

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

saturnin’s picture

subscribing

jibbajabba’s picture

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

web.net’s picture

FileSize
4.67 KB

Try this. Akismet works for me now.

Oliver
President
www.web.net

web.net’s picture

I've ditched Akismet entirely. Use Mollom instead--it's much better.

apaderno’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

I am closing this issue, since it's for a Drupal version not supported.