Bug fix for form helper

Permalink
The standard form helper has a bug in that it doesn't correctly handle two-character IDs (such as 'xm' or 'cs' or the like).

Line 311, which currently reads:
if ((strpos($key, '[]') + 2) == strlen($key)) {


Should be changed to:
if (preg_match('/\[\]$/', $key)) {


Then it will work.

On a related note, I have a blog post about an expansion of the standard form helper.
Check it out if interested.
http://www.onehat.com/blog/2010/08/concrete5-mod-form-helper-tweaks...

Scott

 
andrew replied on at Permalink Reply
andrew
Neat. I will add this to a list of patches and code to check out and look at for future inclusion. Nice work.