Hi-
I created a module to override the comment form. But for some reason, when I click on the 'post reply' button, I get redirected to http://mydomain.com/comment/reply/ which turns out to be a page not found error. I'm trying to find out if my action URL is incorrect. Here's how I have it set up:
I'm using code to put the comment form into a specific content-type by using:
<?php print drupal_get_form('comment_form' , $form); ?>
Then I build my module to override a few things in my comment form. The code in the module is:
<?php
function comments_TFL_form_alter($form_id, &$form) {
if ($form_id == 'comment_form') {
unset($form['_author']);
unset($form['author']);
unset($form['comment_filter']['comment']['#title']);
unset($form['comment_filter']['format']);
$form['#action'] = '/comment/reply/' . $node['nid'] . '#comment-' . $form['cid']['#value'];
/* This is where I'm trying to change the action URL... but the URL is not correct */
}
}
?>
So I get a 'page not found error' when I try to submit a comment. I also checked out the variables that were being passed, and for some reason it doesn't seem to have the $nid or the $cid variables... Also, I have pathauto installed and I'm using clean URLs.... could this be the cause of the problem?
I've been messing with this code for 4 days so any thoughts you have would be really, really appreciated!
Thanks!
Comments
subscribe
subscribe
In my cause the menu_router
In my cause the menu_router table was broken - everyone who have the same issue (error 404 (not 403 - this is problem with your permissions configuration) on in example: comment/reply/some_nid, admin/build/views/list, ...) should check that table and look for missing paths.
greetings from Poland ;)
//sorry for broken english