joomla/joomla-platform — pull request #1268 by elinw (2012-06-09 21:18:54+00:00)
Title: Checkboxes fixes and tests

This fixes a few issues in the checkboxes field.
1. Formerly the field was not checking for stored data when rendering, so it was always using the information from the field definition. Going to the field definition is now conditioned on there not being an existing value.
2. Formerly selecting more than one item to be checked (preset) was not working because the array of checked values was not being created correctly.
Checkboxes continues to have the limitation that it cannot distinguish between a field that is deliberately saved as empty and one that has never been saved, so if the checked element is used it will always render with the checked items when the form is reopened. This is inherent to the structure of the checkboxes field type so developers should be aware of that and use the checked attribute with caution or consider using a "none of the above" option to force a value to be saved.

Tests are for getInput only for now.