Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Major
-
Resolution: Fixed/Completed
-
Affects Version/s: 3.2.3
-
Fix Version/s: 3.3.beta
-
Component/s: Core CiviCRM
-
Labels:None
Description
Creating a long group "Invitees - 25/10/2010 meeting with Bobby Lapointe [XD]" generates a fatal error " is not of type String".
The problem lies on CRM/Utils/String.php
static function titleToVar( $title, $maxLength = 31 ) {
$variable = self::munge( $title);
require_once "CRM/Utils/Rule.php";
if ( CRM_Utils_Rule::title( $variable, $maxLength ) )
return null;
}
if variable > 32 chars, it returns null and CRM_Core_DAO::singleValueQuery in CRM/Group/Form/Edit.php line 353 and dies.
My solution was to :
static function titleToVar( $title, $maxLength = 31 ) {
$variable = self::munge( $title,'_',31 );
require_once "CRM/Utils/Rule.php";
if ( CRM_Utils_Rule::title( $variable, $maxLength ) ) { return $variable; }
return null;
}
1) I'm thinking that the CRM_Utils_Rule::title isn't useful anymore
2) What's the goal in general ? I fail to see the benefit of testing the uniqueness of something that can be "kind of" added by the end user but altered but not seen nor properly manipulated by the end user. Why is it better than the simple test of uniqueness on the title ?
3) wouldn't it be better to have name=md5($title) if title > 32 ?