How to extend (or override) the form block to modify the functionality?
Permalink
I need a new contact form in another page that has a slightly different functionality. Has anyone tried something like this before? I need this for 5.5.1 version.
I need to override the function "action_submit_form" inside "FormBlockController" class.
I need to override the function "action_submit_form" inside "FormBlockController" class.
That could work too but I ended up replicating the existing form block and changed all the class names in the controller and view files. I thought it was easier to do this way and I just made some changes inside the "action_submit_form()" as required. This seems to work perfect for me. I didn't have to change any table names.
I only have one issue though. The new form created is not displayed in Form Results page in the Dashboard. It correctly puts the new form entry in the "btform" table but it does not show it in the Dashboard. Also in the notification email, I get the correct URL like this "http://localhost/mysite/index.php/dashboard/reports/forms/?qsid=1375059378" and it takes me to the page with all the new submissions but the page title does not have the form name. It just reads "Responses to" (without the form name).
Any idea on how to fix this?
I only have one issue though. The new form created is not displayed in Form Results page in the Dashboard. It correctly puts the new form entry in the "btform" table but it does not show it in the Dashboard. Also in the notification email, I get the correct URL like this "http://localhost/mysite/index.php/dashboard/reports/forms/?qsid=1375059378" and it takes me to the page with all the new submissions but the page title does not have the form name. It just reads "Responses to" (without the form name).
Any idea on how to fix this?
Did you get this worked out? I'm trying something similar.
I don't exactly remember what I did as it was a while ago. I think I created a copy of "MiniSurvey" class in the controller.php and renamed the copy to another name. This gave me enough control to make changes to the things inside the new copy of MiniSurvey. Then in the view.php, I instantiated the new class like this:
Remember this was done for version 5.5.1.
$miniSurvey=new MiniSurveyNewForm($b);
Remember this was done for version 5.5.1.
https://github.com/jordanlev/c5_custom_contact_form...
John