[error]: Can't use an undefined value as a HASH reference at /opt/rt5/share/html/Search/Build.html

Am getting the error below when I attempt to search for tickets Search > Tickets > New Search on RTIR 5.0.0
[error]: Can't use an undefined value as a HASH reference at /opt/rt5/share/html/Search/Build.html line 187.

I recently Upgraded from RT 4.4.4 where search was working well.

That line of code is:
'RT::Transactions' => RT->Config->Get('TransactionDefaultSearchResultOrderBy')->{$ObjectType},

Did you set the config “TransactionDefaultSearchResultOrderBy”?

@knation Should this be configured on RT_SiteConfig.pm? I have not set such paramater.
If I may, what options can be set with the above config %DefaultSearchResultOrderBy?

You can check Admin->Tools->System Configuration

First to see what RT is working with!

It should look like:

  'RT::Ticket' => 'id'

@knation cannot find the above config on the displayed configs, how can I set the above config from the RT_SiteConfig.pm

Its a normal config like any other in RT so you can set it in RT_SiteConfig.pm but since it is a default config it is worrying that it isn’t there.


@knation for some reason my RT_config.pm file was missing the TransactionDefaultSearchResultOrder configs, decided to copy RT_config.pm file from another RT running on same version and now its working fine!

Just to check… you are making local config edits in a local copy of the RT_SiteConfig.pm file (usually located somewhere like /opt/rt5/local/etc/RT_SiteConfig.pm)? Don’t edit any of the distribution config files (ie the ones that often live in /opt/rt5/etc in the default RT5 directory tree) as that can either mess things up or you can find your local configurations blown away when you do an RT upgrade.

@GreenJimll ideally changes are made to the RT_SiteConfig.pm file, but we established that my core file RT_Config.pm was missing some configs hence the above error.
Basically what I did was copy RT_Config.pm of another instance (I have 2 instances of RT for external and internal use) and that solved the issue. Both instances are running the same version RT 5.0.0.