civicrm/civicrm-core — pull request #3367 by kirkatcaat (2014-05-27 05:05:14+00:00)
Title: CRM-14747 - Profiles - Fixed error caused by profile fields with empty labels

This patch fixes an error that occurred when viewing a profile in which one or more fields had empty labels.

The function CRM_Profile_Page_Dynamic::run() is used to view a profile. It calls CRM_Core_BAO_UFGroup::getValues to create an array of field values ($values). It then creates an array of field labels ($labels). It expects the indexes of these two arrays to match up. However, there was a mismatch in the code that generated the indexes for these arrays: The indexes are based on the field labels, and the two functions handled empty labels differently. So if one or more labels were empty, the indexes didn't match, which caused an error.

This patch fixes the problem by using the same code to generate the indexes for both arrays.

----------------------------------------
* CRM-14747:
https://issues.civicrm.org/jira/browse/CRM-14747