2 users online. Create an account or sign in to join them.Users

Search

I have noticed that the standard Select Box Field (not the Select Box Link Field) is sorting static options alphabetically, so it does not retain the desired order of items (tested in Symphony 2.0.7 and 2.0.8).

Is this new? Is this intended? Or is this a bug?

So it’s a feature. Thanks.

A feature. But thinking more, it could be considered a bug no? If I enter static options in a specific order, I would expect for them to appear in that order in the dropdown.

If I enter static options in a specific order, I would expect for them to appear in that order in the dropdown.

Yes, this was what I expected. I would find it much more logical if the sort order was:

  • static options first (in the specified order)
  • dynamic options (ascending, either in “natural sorting” or maybe sorted by system ID — I am not sure about this)

What if the Static/Dynamic Options were in there own Optgroup’s?

Then there would be a clear distinction between Static and Dynamic options, and I suppose if you could have different sorting orders without it looking a little strange.

I am not sure about the best solution. Any other ideas?

I have edited field.select.php line:108 to only apply sorting only when there are no Static Options.

Replaced,

natsort($states);

with,

if (strlen($this->_fields['static_options']) == 0) natsort($states);

It is not prefect: when using dynamic options any miscellaneous text in the static options field will change the sort behaviour which might lead ti confusion, however it is working for my needs using Symphony 2.1.2.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.2 or above
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.0 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details