Potential Fix for LightHouse Ticket #3936

I believe I found a fix for this issue. I am here at #CakeFest2013 and during the #HourOfContribution I ran across this issue.

Currently in CakePHP 2.4 on Line 1522 - 1524 you can see the following code:

@@@ php
if ($label) {
	$optTitle = $this->Html->useTag('label', $tagName, '', $optTitle);
}
@@@

The $label variable here the is the $label array passed into the input method in Sethathi example above. The problem is that the $label array is completely ignored and instead a label is created using the HtmlHelper->useTag method.

I have what I believe is a fix for this issue but it hasn't been extensively tested. I tested against Sethathi example in the ticket and it produced the correct result.

The fix is simple. We detect if an array is passed in and then send it to the FormHelper label method instead of the HtmlHelper useTag method. The FormHelper label methods accepts an options array, so we pass in the $label array.

This will probably need to be fixed for checkbox also

"ask":https://cakephp.lighthouseapp.com/users/235987 helped me with this fix
Format to CakePHP code sniffs
Use FormHelper->label instead of HtmlHelper->useTag

Implementing suggested fix by mark_story
Postgres::truncate(): Delete disused code.
Dropping 'Log' suffix from log configs as per change in cb24dbb084.

Reverts regressive change done in 7e28636a72.
Update Model/Behaviors callback signature to be PHP5.4+ compliant.
Merge pull request #1597 from aread22/master

Potential Fix for LightHouse Ticket #3936

Fixes #3936
Fix whitespace error.
Merge pull request #1611 from ADmad/2.4-log-suffix

Dropping 'Log' suffix from log configs as per change in cb24dbb084.
Add test for issue #3936

radio() method should accept an array for the label element.

Refs #3936
Fix CROSS JOINs

While seldomly used, CROSS joins should not generate invalid SQL.

Fixes #4050
Merge pull request #1610 from bar/php54-callback-signatures

Update Model/Behaviors callback signature to be PHP5.4+ compliant.

This may require updates to userland behaviours.
Merge pull request #1614 from okinaka/2.x-disused-code

Postgres::truncate(): Delete disused code.
Fixed race conditions for FileEngine
Merge pull request #1617 from davidsteinsland/master

Fixed race conditions for FileEngine.

Using file_exists() and unlink() together does not ensure atomic results.
Add coding standards ignore comments to FileEngine

We normally disallow error supression but it is the only way to
atomically delete files.
Remove last yoda conditions as per coding standards guidelines.
Merge pull request #1618 from dereuromark/master-cs

Remove last yoda conditions as per coding standards guidelines.
JsonView should return null if no data is set, regardless of the type of '_serialize'.
It should also honor true/false/0/'' values.
Merge pull request #1613 from bar/json-view

JsonView should return null if no data is set, regardless of the type of '_serialize'.