RotherOSS / RotherOSS/otobo

DynamicFieldDB: Search in input field triggers an error when no value item is selected as search field

Open
#1,663 2 comments 0 reactions 2 assignees View on GitHub

@stefanhaerter is already working on this.

Since Jul 7, 2022.

Dominant language
Perl
Stars
337
Forks
89
Avg merge
13h 25m
Merged PRs (30d)
34

Description

Given a field like

image

where no value item is selected as a search field, a search in the input field

image

triggers an error:

ERROR: OTOBO-CGI-80 Perl: 5.30.0 OS: linux Time: Fri Mar 11 08:06:18 2022

 Message: ERROR:  syntax error at end of input
LINE 1: ...ELECT login,first_name || ' ' || last_name FROM users WHERE 
                                                                       ^, SQL: 'SELECT login,first_name || ' ' || last_name FROM users WHERE '

 RemoteAddress: 172.17.0.1
 RequestURI: /otobo/index.pl?

 Traceback (263): 
   Module: Kernel::System::DynamicFieldDB::DatabaseSearchByConfig Line: 548
   Module: Kernel::Modules::AgentDynamicFieldDBSearch::Run Line: 311
   Module: Kernel::System::Web::InterfaceAgent::Content Line: 1239
   Module: Kernel::System::Web::InterfaceAgent::Response Line: 1321
   Module: Kernel::System::Web::App::call Line: 86
   Module: Plack::Component::__ANON__ Line: 50
   Module: Plack::App::URLMap::call Line: 71
   Module: Plack::Component::__ANON__ Line: 50
   Module: Plack::Sandbox::_2fopt_2fotobo_2fbin_2fpsgi_2dbin_2fotobo_2epsgi::__ANON__ Line: 200
   Module: Plack::Sandbox::_2fopt_2fotobo_2fbin_2fpsgi_2dbin_2fotobo_2epsgi::__ANON__ Line: 170
   Module: Plack::Sandbox::_2fopt_2fotobo_2fbin_2fpsgi_2dbin_2fotobo_2epsgi::__ANON__ Line: 156
   Module: Plack::Middleware::HTTPExceptions::try {...}  Line: 20

The WHERE clause is empty. I see three possible solutions:

  • Do not save the dynamic field configuration unless (at least) one value item is selected as search field
  • Use the first value item as the default search field
  • Use the identifier as the default search field

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.