[rt-users] RTFM problems creating and searching articles

Adaktylos Philipp p.adaktylos at christely.com
Tue Feb 27 14:43:12 EST 2007


hi list,
i was able to solve one of my issues with RTFM by myself.
the problem description was as follows:

> hi list,
> i installed RT 3.4.6, AssetTracker 1.2.3 and RTFM 2.2.0RC4 (upgraded
> from 2.1.40) on Ubuntu 6.06 LTS (Apache 2.0.55, Perl 5.8.7).
> so far everything works quite fine, but i still have some issues with
> RTFM:
>
> 1.) the class sort order in RTFM is not alphabetical. this is really
> annoying. is there a way to change that? if not could someone give me
a
> hint how to customize my RTFM installation to achieve this?
> btw. this issue is already listed in the RTFM bug list since nov 2003
> (http://rt3.fsck.com/Ticket/Display.html?id=4140 login: guest pwd:
> guest)

Cause:
in /opt/rt3/local/lib/RT/FM/ClassCollection.pm in the _Init sub it says:
  # By default, order by name
  $self->OrderBy( ALIAS => 'main',
                  FIELD => 'SortOrder',
                  ORDER => 'ASC');
i looked up SortOrder in my database and all these fields were 0.

Solution:
The obvious solution is to change 'SortOrder' to 'Name'. But as stated
in the files comments its better to create a file called
ClassCollection_Local.pm and make the changes there.
My ClassCollection_Local.pm looks like this:
---------------------------------------
use strict;

package RT::FM::ClassCollection;

no warnings qw/redefine/;


sub _Init {
    my $self = shift;
    $self->{'table'} = 'FM_Classes';
    $self->{'primary_key'} = 'id';


    # By default, order by name
    $self->OrderBy( ALIAS => 'main',
                    FIELD => 'Name',
                    ORDER => 'ASC');

    return ( $self->SUPER::_Init(@_) );
}

1;
---------------------------------------

Resources:
http://search.cpan.org/dist/DBIx-SearchBuilder/SearchBuilder.pm

greetings

Philipp Adaktylos



More information about the rt-users mailing list