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) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Custom data fields > Multiple Choice Options > too many objects?
Pages: [1]

Author Topic: Custom data fields > Multiple Choice Options > too many objects?  (Read 2226 times)

madjoe

  • Guest
Custom data fields > Multiple Choice Options > too many objects?
November 04, 2008, 05:33:17 am
Hi! I've built quite a big list of the multiple choice option of my custom data field.
Now my FF browser can't display the full generated HTML page, because the output HTML breaks while displaying my the list (without an obvious error message displayed on screen and no trace within the Apache error.log). I assumed the problem might be in reading the last HTML line displayed by the length of more than 900K characters within, so I've edited this file: civicrm\templates\CRM\Custom\Page\Option.tpl and added a Smarty {"\n"} for a "new carriage return" to split the godzilla line.

Code: [Select]
        {foreach from=$customOption item=row}
        <tr class="{cycle values="odd-row,even-row"} {if NOT $row.is_active} disabled{/if}">
            <td>{$row.label}</td>
            <td>{$row.value}</td>
            <td>{$row.default_value}</td>
            <td class="nowrap">{$row.weight}</td>
            <td>{if $row.is_active eq 1} {ts}Active{/ts} {else} {ts}Inactive{/ts} {/if}</td>
            <td>{$row.action}</td>
        </tr>{"\n"}
        {/foreach}

That helped, so I don't have a line that big in my source code of the page, but the result in my browser is still the same. The page breaks somewhere within that foreach loop. Maybe it's some PHP memory limitation for handling objects, so I've set memory_limit to 512M. Still no change.

What am I missing? Please help!
Thanks!
« Last Edit: November 04, 2008, 05:34:55 am by madjoe »

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: Custom data fields > Multiple Choice Options > too many objects?
November 04, 2008, 06:42:08 am

This might not be the answer u are looking for, but you might want to consider splitting your "big list" into multiple smaller lists. Generating so much HTML (900K) is probably not very efficient and might have other affects also. I'm not sure if we store things properly if a lot of options are checked. I think we store things in a varchar(255) which means not more than 50-80 options can be stored at any given time (assuming your values are incremented starting from 1)

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

madjoe

  • Guest
Re: Custom data fields > Multiple Choice Options > too many objects?
November 04, 2008, 08:02:50 am
I wanted to say that there were more than 900.000 characters in a single HTML line that was generated by the foreach-loop mentioned from above. That list has been used like some kind of a tagging system, since I already use "Tags" for another, similar purpose.

How could I split my list of options? By creating another custom field with multiple options, etc, etc.?
« Last Edit: November 04, 2008, 08:05:16 am by madjoe »

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: Custom data fields > Multiple Choice Options > too many objects?
November 04, 2008, 10:30:24 am
Quote from: madjoe on November 04, 2008, 08:02:50 am
How could I split my list of options? By creating another custom field with multiple options, etc, etc.?

yes, i would create a few custom fields and split the options across the various fields

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

madjoe

  • Guest
Re: Custom data fields > Multiple Choice Options > too many objects?
November 04, 2008, 03:29:30 pm
Ok, thanks! But please tell me is this happening due to PHP limitations, or what? I'd like to increase some memory just to add a few more lines, but I don't know what to increase...  ???

I'd like to know if something like a free-tagging would help to solve this issue at all (as a new feature, instead of those "multiple options")? I've already mentioned free-tagging here: http://forum.civicrm.org/index.php/topic,4378.msg19086.html#msg19086

I'd also like to donate and support to solve this problem, but I don't know how much would it cost.

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: Custom data fields > Multiple Choice Options > too many objects?
November 04, 2008, 04:06:57 pm

I'm not sure what the problem is, so cant really help you out there

I think incorporating free-tagging into CiviCRM is a 25-100 hour project (depending on how we scope it out, how extensive we want to make it etc). Our consulting rates and contract are on the wiki: http://wiki.civicrm.org/confluence/display/CRM/Consulting+Services+Agreement

You might want to try to get a group of users together who need this feature to raise the needed amount

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

madjoe

  • Guest
Re: Custom data fields > Multiple Choice Options > too many objects?
December 03, 2008, 05:28:24 am
Is there a way for me to avoid viewing a list of ALL multiple options on one page just to see a button for adding a new option?!

I think this list of multiple options should have pagination as well. Also, this button should be at the top of the page too, for usability reasons.

Sorry, for this duplicate, I forgot that I've already opened an issue:
http://forum.civicrm.org/index.php/topic,5814.msg25483.html#msg25483

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Custom data fields > Multiple Choice Options > too many objects?

This forum was archived on 2017-11-26.