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) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • AdvSelect bug in 3.3.3
Pages: [1]

Author Topic: AdvSelect bug in 3.3.3  (Read 734 times)

jtillman

  • I’m new here
  • *
  • Posts: 7
  • Karma: 0
AdvSelect bug in 3.3.3
February 01, 2011, 08:06:28 pm
There's a pretty troublesome bug in 3.3.3 if you create an AdvSelect as a Custom Data field and give it a very long list of options.

Because multi-select uses a simple text field with all the applied values from the multi-select concatenated together with unprintable characters, and because AdvSelect fields have a default length of 255 characters, if your selected options from the list totals more than 255 characters, then it will silently be truncated.

Adding more values to a form with one of these "maxed-out" lists results in no addition being saved, and no error reported.

I was able to fix my own issue by modifying the civicrm_custom_field record for my AdvSelect data element and entering a length of 1024 (plenty for my purposes).  Because that record is only metadata, and is not the actual data field itself, I also had to modify the table the values are stored in "civicrm_values_whatever" where "whatever" is the name of the group your field is in.  I had to change the length of the varchar field to 1024.

This is, of course, only a hack that makes it work.  The problem still exists.  Just thought someone would like to know if it hasn't already been reported.

Another side note:  Views2 integration is severely broken for multi-selects in CiviCRM as regards filters.  Don't use them if you intend to do any significant filtering.  The "contatenate with unprintable characters" method does not play well in Views2 filters.

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: AdvSelect bug in 3.3.3
February 01, 2011, 09:28:42 pm

can you please file an issue. I think detecting this and aborting the operation if we see the length is greater than the db column is a good thing to do. At a later stage, we could potentially fix the meta data and the column and allow them to auto-expand

the views2 issue is a known issue scheduled to be fixed in a future release (4.1 for now)

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

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
Re: AdvSelect bug in 3.3.3
February 02, 2011, 06:47:45 am
i've run into this as well. threw me off for a bit.

i think the vast majority of users give no thought to the database field length. only technical users would even give consideration to it. so if its possible to have the field length expand to meet the changing use of the data, that would be ideal. and we could probably remove the option altogether. just a hunch, but i suspect that option was more important back in the pre v2.0 days when all custom field values were stored in a single table, rather than the current data model, which is much more extendable.
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

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: AdvSelect bug in 3.3.3
February 02, 2011, 08:57:30 am

issue filed here:

http://issues.civicrm.org/jira/browse/CRM-7481

fix has been checked for 3.4.alpha1 (rev #: 32171)

https://fisheye2.atlassian.com/changelog/CiviCRM/?cs=32171 (will appear there later today)

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) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • AdvSelect bug in 3.3.3

This forum was archived on 2017-11-26.