page_list block with custom action - page not found

Permalink
Hi,

I want to customize the PageList block (with an additional search bar which requires a new action).

In my BASE_URL/application/blocks/page_list/view.php, I have:
<form class="form-wrapper cf" action="<?php echo $view->action('customised') ?>" method="post" enctype="multipart/form-data">

The generated form action URL seems correct: BASE_URL/page/customised/{bID}

In my BASE_URL/application/blocks/page_list/controller.php, I have:
<?php
namespace Application\Block\PageList;
use Concrete\Block\PageList\Controller as PageListBlockController;
class Controller extends PageListBlockController{
public function action_customised($bID = false){
   $this->view();
}
}

The extend is working since I can add other functions which work.

But for an unknown reason, I always get a 404 error (Page not found) when I submit my form with the defined action (BASE_URL/page/customised/{bID}).

Thank you in advance for your help!
Cheers,
marc

marcsublet
View Replies:
JohntheFish replied on at Permalink Reply
JohntheFish
As an experiment, you could try calling one of the pre-existing block controller actions and supplying the appropriate parameters. It will obviously fail, but maybe confirm there is a problem with the way your action is being 'discovered' by the core.
marcsublet replied on at Permalink Reply
marcsublet
Hi John,

Thanks for the tip.
I have tried with an action defined in the "page_list" block and I get the same 404 error (= the action is not processed).

To be sure, I have duplicated/edited my custom view and controller to the "content" block. Tada! It's working flawlessly as it has to work.

My problem seems to be related to the "page_list" block especially.
If you have an idea, it's very welcome! I will submit it as a bug but I am curious if someone can duplicate the behavior.

Regards,
marc