Skip to content
Snippets Groups Projects
Commit 0e9de3f5 authored by kirkatcaat's avatar kirkatcaat
Browse files

CRM-12133: Changed OptionValue's auto-increment function to use numeric...

CRM-12133: Changed OptionValue's auto-increment function to use numeric comparison instead of string comparison.
parent e5786a6b
Branches
Tags
No related merge requests found
......@@ -111,7 +111,7 @@ class CRM_Core_BAO_OptionValue extends CRM_Core_DAO_OptionValue {
}
$bao->selectAdd();
$bao->whereAdd("value REGEXP '^[0-9]+$'");
$bao->selectAdd('(ROUND(COALESCE(MAX(value),0)) +1) as nextvalue');
$bao->selectAdd('(ROUND(COALESCE(MAX(CONVERT(value, UNSIGNED)),0)) +1) as nextvalue');
$bao->find(TRUE);
return $bao->nextvalue;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment