I tried to change the foreignkey drop down to text field in the symfony filter form. But after i change the drop down field to text field, my field name changed to xxx_filter[‘foreign_id’][‘text’] instead of xxx_filter[‘foreign_id’]. And everytime i submit the form it show “SQLSTATE[HY093]: Invalid parameter number: parameter was not defined”.
After few hours of googling, i manage to find the solution for this filter form problem. To solve the problem follow the steps below:-
Advertisements
- Open your filter class from lib/doctrine/yyyyFormFilter.class.php
- now you add a function in the yyyyFormFilter.class.php file like below:-
12345public function convertXXXXXXValue($value) {if (is_array($value) && isset($value['text']) && '' != $value['text']) {return $value['text'];}}
** replace the XXXXXX to your column name - Now you may try your form again. It should be working now 🙂
Related posts:
Free image editor for Mac OS X / XP / Vista / Linux
SVN: How to commit only modified files via command line
How to install Fedora to USB drive
CPAN Error: make test had returned bad status, won't install without force
Prestashop 1.6: "Unexpected token <" error when upload category thumbnail
Composer: PHP Fatal error: Allowed memory size of ... exhausted...
Rip DVD Movies with Handbrake
Free Project Management software for Mac OS X - GanttProject
Share this with your friends:-