civicrm/civicrm-core — pull request #309 by kirkatcaat (2013-04-02 17:11:53+00:00)
Title: Fixes auto-increment in OptionValue BAO (CRM-12133)

When creating an OptionValue, you can omit the value field, and it should automatically be assigned next highest integer value within the OptionGroup. However, this auto-increment feature is broken in CiviCRM 4.3 beta 5. It works up until a value of 10 and then it gets stuck on 10. This is because the function CRM_Core_BAO_OptionValue::getDefaultValue() is using string comparison instead of numeric comparison when calculating the highest current value, so '9' appears larger than '10'.

This commit changes that function to use integer comparison instead of string comparison. This fixes the problem with [CRM-12133](http://issues.civicrm.org/jira/browse/CRM-12133).