Posts

Custom Form Error in Symfony 5 (form_errors)

While you can add attributes to form_label and form_widget to customise form_errors you have to use a template. Add a twig template "templates/form/form_errors.html.twig" Paste in the below {% block form_errors %}     {% if errors|length > 0 %}     <ul class="error_list">         {% for error in errors %}             <li>{{ error.message }}</li>         {% endfor %}     </ul>     {% endif %} {% endblock form_errors %} Edit "config/packages/twig.yaml" Add in the template details eg. twig:     default_path: '%kernel.project_dir%/templates'     form_themes:         - 'form/form_errors.html.twig' Based on Symfony 2 instructions found here

Using variables within ajax success function that were set before ajax call (JQuery)

I spent several hours trying to access variables that were set before an Ajax call, turns out there is a simple solution. To be able to access the variables you need to set them as parameters within the Ajax call and then to access them in the success function you prefix them with "this." eg. var a = 1; $.ajax({             type: "POST",             contentType: "application/json; charset=utf-8",             url: "theurl.com",             data: '{a: a}',             dataType: "json",             a: a,             success: function (msg) {                     var arr = eval(msg.d);                     process(arr, this.a );             }         });

qshape command not found - Postfix

To use qshape you need to install postfix-perl-scripts below are the commands for the major distros Fedora/Centos/Redhat yum install postfix-perl-scripts Debian, Ubuntu apt-get install postfix-perl-scripts Mandriva urpmi postfix-perl-scripts Suse yast -i  postfix-perl-scripts If this won install or wont run once installed then you may need to install perl, use the commands above but replace postfix-perl-scripts with perl Original Source: http://jerrylparker.com/?p=56

System.Runtime.InteropServices.COMException (0x800A03EC)

System.Runtime.InteropServices.COMException (0x800A03EC) Top answer solved this for me.

System.Security.Policy.PolicyException: Required permissions cannot be acquired.

Spent ages trying to work out what was causing this error, eventually found the link below.  http://blkarwasara.blogspot.co.uk/2012/02/exception-details-systemsecuritypolicyp.html

Network settings config file locations

For some reason webmin can no longer update network configuration changes correctly. So for instructions on how to change them manually follow the link below. Network settings config file locations: http://fedoraproject.org/wiki/Anaconda/Network#Editing_configuration_files

PHP and MySQL Pagination

PHP/MySQL select data and split on pages Found this useful article on howto split MySQL records onto pages. So if you want to show only 20 records per page then follow the link.