Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-6958

Creating a group longer than 32 chars with "exotic" chars generates a fatal error

    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 $variable; }

      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 ?

        Attachments

          Activity

            People

            • Assignee:
              lobo Donald A. Lobo
              Reporter:
              xavier xavier dutoit
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: