Concrete5.7.5.6 - form submission Error 404 Page Not Found

Permalink
I'm overriding a Page List block - I want to add a contact form at the bottom of the Page List block (not this simple, but for the purpose of the question and solving the problem it will do). I copied the page list block folder into the application/blocks.

I have a working package with a contact form. I added my working form block to the page at the bottom of the page list block - everything works just fine. Just to be sure the contact form block works fine.

Then I removed the form block. Copied my working code from my contact form package's block into the view.php and controller.php of the page list block I'm overriding. I press the submit button - and it gives me the Error 404 Page Not Found after going to page 'mysite.com/submit_form/1008#formblock1008'.

What could be wrong? The piece of code works in the separate contact form block but not in my overriden page list block. I'm puzzled.

I replaced the view and controller files in the page list block for those from my contact form block - everything works! But not when I add the code to the existing view and controller files.

Just as another test, I've added my contact form block just below the page list block - it works just fine. I'm absolutely clueless... Could there be some sort of conflict? I couldn't even imagine between what.

view.php
<div class="row">
    <?php
            $form = Loader::helper('form');
            $formAction = $view->action('submit_form').'#formblock'.$bID;
    ?>
    <div id="formblock<?php  echo $bID; ?>" class="ccm-block-type-form">
    <form id="contact_form" 
            enctype="multipart/form-data" 
            action="<?php echo $formAction?>" 
            method="post" 
            accept-charset="utf-8">
            <div class="form-group">
                    <?php 
                            echo $form->label('name', "Name");
                            echo $form->text('name', $name);

controller.php:
public function action_submit_form() {
    $txt_message = "Test email";
    $mh = Core::make('helper/mail');
    $mh->to($this->email_to, $this->site_name);
    $mh->from($this->email, $this->name);
    $mh->replyto($this->email, $this->name);
    $mh->setSubject($this->subject);
    $mh->setBody($txt_message);
    @$mh->sendMail();
}

linuxoid
View Replies:
marcsublet replied on at Permalink Reply
marcsublet
Hi,

I have the same problem with the PageList block.
Do you have found the reason/a workaround?

Thanks,
marc