tractorcow-farm / silverstripe-fluent

Multi-language translate module for Silverstripe, without having to manage separate site trees.
BSD 3-Clause "New" or "Revised" License
93 stars 111 forks source link

Search in Localisation tab does not work #875

Closed satrun77 closed 3 months ago

satrun77 commented 3 months ago

Module version(s) affected

7.1.3

Description

The search functionality of the grid field in the Localisation tab does not work.

The error

[Emergency] Uncaught TypeError: SilverStripe\ORM\Search\SearchContext::prepareQuery(): Argument #3 ($existingQuery) must be of type ?SilverStripe\ORM\DataList, SilverStripe\ORM\ArrayList given, called in /Users/mo/Sites/immigration-nz/vendor/silverstripe/framework/src/ORM/Search/SearchContext.php on line 162

The issue is with the return data type from https://github.com/tractorcow-farm/silverstripe-fluent/blob/7/src/Extension/Traits/FluentObjectTrait.php#L69 is ArrayList

How to reproduce

  1. Install a fresh installation
  2. Add fluent module
  3. Setup locales
  4. Add a page for all of the created locales
  5. Edit a page
  6. Go to Localisation tab
  7. Use the search functionality within the grid field.
  8. You should get a server error window popup, and inspecting the network console shows the error received from the server

Possible Solution

Remove GridFieldFilterHeader from GridFieldConfig in https://github.com/tractorcow-farm/silverstripe-fluent/blob/7/src/Extension/Traits/FluentObjectTrait.php#L161

Additional Context

No response

Validations

satrun77 commented 3 months ago

Fixed in #876