CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Alpha and Beta Release Testing »
  • 2.2 Release Testing »
  • Error creating Custom Data Group
Pages: [1]

Author Topic: Error creating Custom Data Group  (Read 11363 times)

atif

  • Guest
Error creating Custom Data Group
February 23, 2009, 07:02:22 am
Hello,

I get following error message while creating a custom data group.

I'm using CiviCRM 2.2beta2 running on Drupal 6.9 on an IIS6 server.

Here's what I'm trying to do:

Group Name: Student Details
Used for: Contacts
Order: 2
(Not Ticked) Does this Custom Data Group allow multiple records?
Display Style: Inline
(Ticked) Collapse this group on initial display
(Ticked) Is this Custom Data Group active?


Quote
New Custom Data Group

unrecoverable error
    Sorry. A non-recoverable error has occurred.

    DB Error: a515ac9c2796ca0e23adbe92c68fc9fc

    Database Error Code: Field 'min_multiple' doesn't have a default value, 1364

    Return to home page.

Error Details:

Array
(
    [callback] => Array
        (
           
  • => CRM_Core_Error
  • [1] => handle
            )

       
Code: [Select]
=> a515ac9c2796ca0e23adbe92c68fc9fc
    [message] => DB Error: a515ac9c2796ca0e23adbe92c68fc9fc
    [mode] => 16
    [debug_info] => INSERT INTO civicrm_custom_group (name , title , extends , style , collapse_display , help_pre , help_post , weight , is_active , table_name , is_multiple , max_multiple ) VALUES ('Student_Details' , 'Student Details' , 'Individual' , 'Tab' ,  1 , '' , '' ,  2 ,  1 , 'civicrm_value_student_details' ,  1 ,  1 )  [nativecode=1364 ** Field 'min_multiple' doesn't have a default value]
    [type] => DB_Error
    [user_info] => INSERT INTO civicrm_custom_group (name , title , extends , style , collapse_display , help_pre , help_post , weight , is_active , table_name , is_multiple , max_multiple ) VALUES ('Student_Details' , 'Student Details' , 'Individual' , 'Tab' ,  1 , '' , '' ,  2 ,  1 , 'civicrm_value_student_details' ,  1 ,  1 )  [nativecode=1364 ** Field 'min_multiple' doesn't have a default value]
    [to_string] => [db_error: message="DB Error: a515ac9c2796ca0e23adbe92c68fc9fc" code=0 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_custom_group (name , title , extends , style , collapse_display , help_pre , help_post , weight , is_active , table_name , is_multiple , max_multiple ) VALUES ('Student_Details' , 'Student Details' , 'Individual' , 'Tab' ,  1 , '' , '' ,  2 ,  1 , 'civicrm_value_student_details' ,  1 ,  1 )  [nativecode=1364 ** Field 'min_multiple' doesn't have a default value]"]
)
[/quote]

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Error creating Custom Data Group
February 23, 2009, 09:16:21 am

can you reproduce this on the demo machine (http://drupal.demo.civicrm.org/) I tried a few times and failed to reproduce

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

atif

  • Guest
Re: Error creating Custom Data Group
February 23, 2009, 09:39:02 am
It works fine on demo server. Would it make a different that I have upgraded from 2.1 and one of my custom group was created using that version?

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Error creating Custom Data Group
February 23, 2009, 09:46:40 am

can you run the following command on your mysql database

mysql>show create table civicrm_custom_group \G;

and show us the output

thanx

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

atif

  • Guest
Re: Error creating Custom Data Group
February 23, 2009, 09:56:07 am
Quote
'civicrm_custom_group', 'CREATE TABLE `civicrm_custom_group` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Unique Custom Group ID',
  `name` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Variable name/programmatic handle for this group.',
  `title` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Friendly Name.',
  `extends` enum('Contact','Individual','Household','Organization','Location','Address','Contribution','Activity','Relationship','Group','Membership','Participant','Event','Grant','Pledge','Case') COLLATE utf8_unicode_ci DEFAULT 'Contact' COMMENT 'Type of object this group extends (can add other options later e.g. contact_address, etc.).',
  `extends_entity_column_id` int(10) unsigned DEFAULT NULL COMMENT 'reference to option value',
  `extends_entity_column_value` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'linking custom group for dynamic object',
  `style` enum('Tab','Inline') COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Visual relationship between this form and its parent.',
  `collapse_display` int(10) unsigned DEFAULT '0' COMMENT 'Will this group be in collapsed or expanded mode on initial display ?',
  `help_pre` text COLLATE utf8_unicode_ci COMMENT 'Description and/or help text to display before fields in form.',
  `help_post` text COLLATE utf8_unicode_ci COMMENT 'Description and/or help text to display after fields in form.',
  `weight` int(11) NOT NULL DEFAULT '1' COMMENT 'Controls display order when multiple extended property groups are setup for the same class.',
  `is_active` tinyint(4) DEFAULT NULL COMMENT 'Is this property active?',
  `table_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Name of the table that holds the values for this group.',
  `is_multiple` tinyint(4) DEFAULT NULL COMMENT 'Does this group hold multiple values?',
  `min_multiple` int(10) unsigned COMMENT 'minimum number of multiple records (typically 0?)',
  `max_multiple` int(10) unsigned COMMENT 'maximum number of multiple records, if 0 - no max',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UI_title_extends` (`title`,`extends`),
  UNIQUE KEY `UI_name_extends` (`name`,`extends`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci'

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Error creating Custom Data Group
February 23, 2009, 02:19:27 pm

thats the same definition we have in a pristine db schema. I'm not very sure why your version of mysql is complaining about min_multiple does not have a default value. whats your mysql server sql_mode?

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

atif

  • Guest
Re: Error creating Custom Data Group
February 24, 2009, 02:19:34 am
STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

atif

  • Guest
Re: Error creating Custom Data Group
February 24, 2009, 09:45:10 am
do you think a change in sql_mode is required?

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Error creating Custom Data Group
February 24, 2009, 10:13:42 am

i dont think so. i have STRICT_TRANS_TABLES and it works fine for me (i dont think the other 2 options matter in this case)

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

atif

  • Guest
Re: Error creating Custom Data Group
February 24, 2009, 10:46:18 am
Hmmmm ... Thank you for your replies so far.

Anything else you reckon I should try?

atif

  • Guest
Re: Error creating Custom Data Group
February 27, 2009, 03:20:25 am
Strangely so I went through file CRM\Core\BAO\CustomGroup.php and the following line was commented out!

//$group->min_multiple     = ( $params['min_multiple'] >= '0' ) ? $params['min_multiple'] : 'null';

Enabling this line seems to have resolved the problem.

Lobo, thanks for your help anyway.

JoopSJ

  • I post occasionally
  • **
  • Posts: 80
  • Karma: 2
Re: Error creating Custom Data Group
May 14, 2009, 03:30:42 am
Hello,
I'm using 2.2.2 and have the same thing and solved it by uncommenting the abovementioned lines.
Is this already fixed in 2.2.3 ore should I file an issue?

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Error creating Custom Data Group
May 14, 2009, 07:53:25 am

can u file an issue. we'll fix in 2.2.4. also include your mysql version info

not sure why it happens on some mysql servers :(

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Alpha and Beta Release Testing »
  • 2.2 Release Testing »
  • Error creating Custom Data Group

This forum was archived on 2017-11-26.