Skip to content

Empty result section is rendered for accelerated classes even when enable_enlarge is false #919

@AlxFrst

Description

@AlxFrst

Are you willing to create (at a later stage) a PR for that?

Yes

iTop version

3.2.2-1

PHP version

8.2

Reproduction procedure

Context

When configuring full_text_accelerators with enable_enlarge => false on a class, iTop still renders an empty "0 result" section for that class in the global search results. The section contains only a header (Found 0 object(s) of class X.) with no actionable
button, since the enlarge action is explicitly disabled by configuration.

On instances with several accelerated classes configured this way, the user has to scroll past a stack of dead-end "0 result" sections to reach the classes that actually matched the query.

Steps to reproduce

  1. Add the following to conf/production/config-itop.php in $MySettings:

    'full_text_accelerators' => array(
        'Person' => array(
            'query'          => 'SELECT Person WHERE name LIKE :needle OR first_name LIKE :needle OR email LIKE :needle',
            'attributes'     => array('name'),
            'enable_enlarge' => false,
        ),
    ),
  2. Log in to the iTop backoffice.

  3. In the global search bar, enter a string that does not match any Person record (e.g. zzzzzz) and press Enter.

  4. Expected: no Person section is rendered in the results — there is no actionable content to show.

    Actual: a <div class="search-class-result search-class-Person"> block is rendered with the header Found 0 object(s) of class Person. and an empty action area.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No fields configured for Bug.

    Projects

    Status
    Pending review

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions