Re: Trying to sort the values of a CF

Kevin Falcone <[email protected]>
Newsgroups gmane.comp.bug-tracking.request-tracker.devel
Message-ID <[email protected]>
On Fri, Jul 04, 2014 at 04:20:19PM +0200, Joop wrote:
> I would like to sort the content of a CF of type 'enter multiple values'.
> I had a look at the element displaying this but can't make this work.
> Probably my very weak perl skills are the problem.

How do you want to sort them, can you do a database sort?

> % my $Values = $Object->CustomFieldValues( $CustomField->Id );

You can say $Values->OrderBy(FIELD => 'Content', ORDER => 'ASC');
https://metacpan.org/pod/DBIx::SearchBuilder#OrderBy-PARAMHASH

If you need to do it in perl, you need to rewrite that loop using
ItemsArrayRef and passing through perl's sort().

Alternately, you could modify the code that stores, since it stores an
OrderBy field which is what RT normally uses to display.

Keep in mind that changing here will not change the editing view while
ensuring SortOrder is correct will work there.

-kevin

-- 
RT Training - Boston, September 9-10
http://bestpractical.com/training
signature.asc (application/pgp-signature, 235 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (Darwin)
Comment: GPGTools - http://gpgtools.org

iEYEARECAAYFAlO/PeoACgkQ0+gKWp5CJQrsugCfSHgSesOgBOmHvhTPgDoYBVCg
NY0AoItIa76YVQ4rvjVEctY8lc+tCI5Z
=7s90
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.