Overriding Form Block action_submit_form() method in 5.6+

Permalink
Read through many forum posts and am unable to do the most basic override. In 5.5- this was a trivial matter. There is one key point in the new 5.6+ overrides methodology that is escaping me despite reading for hours. Yes, my caches are all off, and cleared.

I want to make a simple change to
/concrete/core/controllers/blocks/form.php --> action_submit_form() function

I have copied
/concrete/blocks/form/controller.php to /blocks/form/controller.php

Using the stub as a starting point, I attempt to override the action_submit_form() function like this:
<?php  
defined('C5_EXECUTE') or die("Access Denied.");
class FormBlockController extends Concrete5_Controller_Block_Form {}
class FormBlockStatistics extends Concrete5_Controller_Block_FormStatistics {}
class MiniSurvey extends Concrete5_Controller_Block_FormMinisurvey {
   public function action_submit_form() { 
      print "you are here";
      exit;
   }
}

No love. Intentional parse errors break form submits, so I know the loader is getting to my new function, but it doesn't seem to be respecting my function in place of the core function.

Help appreciated.

 
ConcreteOwl replied on at Permalink Best Answer Reply
ConcreteOwl
Try This in your controller
<?php  
defined('C5_EXECUTE') or die("Access Denied.");
class FormBlockController extends Concrete5_Controller_Block_Form {
public function action_submit_form() { 
print "you are here";
exit;
}
}
class FormBlockStatistics extends Concrete5_Controller_Block_FormStatistics {}
class MiniSurvey extends Concrete5_Controller_Block_FormMinisurvey {}
setsail replied on at Permalink Reply
That did the trick. So, looking at your code example that works, I can't reconcile it with the examples shown in:

http://www.concrete5.org/documentation/how-tos/developers/overridin...

Is replacing the function in the first class declaration best practice, or unique to this class, or is the log library example shown it's own unique case. Is there some coherent methodology to know which class the desired override function belongs in?
ConcreteOwl replied on at Permalink Reply
ConcreteOwl
Basically you were trying to over-ride a function in the form_minisurvey.php file that actually exists in the form.php file,
i.e. the "public function action_submit_form()"
The controller has three classes to control
form.php, form_statistics.php and form_minisurvey
You need to make sure you use the correct class for the file you are over-riding..