Problems, need help? Have a tip or advice? Post it here.
4 posts Page 1 of 1
In one of my dropdowns I have just under 600 possible options. I can include 510 of them without issue, but once I go over that number the rendering in admin has problems. I've attached a screenshot of what I see when I include all the options.

I've also included code to show how I am doing this. Please note it has the snippets folder set to 'inc' in couch config.

I tried doing this via
  1. embed (as in example code)
  2. putting it in a variable (cms:set) then using cms:show
  3. as just regular text in the parameter

I also checked the other 90 options on their own and they all come through just fine.

It seems like there is either a character or option count limit for dropdowns options, is this the case?



The problem (and solution) is that indeed there is a database schema limit for description of all fields of repeatable region. Dropdown options are part of description, so a lot of them were not expected by design.

The solution is simple - go to phpmyadmin (or whatever you use for db-ops) and do
ALTER TABLE `couch_fields`
CHANGE COLUMN `custom_params` `custom_params` LONGTEXT NULL AFTER `dynamic`;

If you specified table prefix in couch/config.php file, then change 'couch_fields' above accordingly. See the actual db table name to be sure about it.

Everything will work immediately after.
Maybe @KK will make it permanent or suggest other solution.
That did it, thanks!

Does the same or a similar limit apply to dropdowns outside of a repeatable? I'm not clear on how the custom_params field is used but I'm assuming it is for storing opt_values.

Could an alternative (for those not willing/able to make DB changes) be to use dynamic='opt_values'? This was detailed by KK here: viewtopic.php?p=2483#p2483.

Exactly the same problem was reported by @cheesypoof just a couple of months back.
I'll quote verbatim my reply as that applies to this case also -


Repeatable region stores all its child regions definitions as a base-encoded blob into field 'custom_params' of 'couch_fields'.
This field is MySQL 'TEXT' with a maximum size of 65,535 bytes.

With the snippet used in our use-case, the length of the data to be saved is coming to 85,356 bytes which is then getting truncated. Ergo the problem in loading it back.

Even the 'opt_values' field (if this drop-down is used in a normal i.e. non-repeatable manner) is a TEXT, so potentially can lead to the same problem. In this case, it barely escapes overshooting the limit because it does not base-encode the values.

Anyway, I think 65K is a sane limit for normal cases so we shouldn't change it.
Our problem use-case can be easily handled in the following alternative manner -
Code: Select all
<cms:repeatable name='test' >
    <cms:editable name='icon' opt_values='icons.html' dynamic='opt_values' type='dropdown'/>


@temp10293, so, yes, using the 'dynamic' parameter and placing the data in snippets is the preferred solution.
4 posts Page 1 of 1

Who is online

In total there are 2 users online :: 0 registered, 0 hidden and 2 guests
(based on users active over the past 5 minutes)

Users browsing this forum: No registered users and 2 guests