-
Notifications
You must be signed in to change notification settings - Fork 824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
4.13 Regression: GridFieldFilterHeader now assumes that records are "searchable" #10768
Comments
We'll go with resolution one - requiring those methods was an unintended breaking change |
I've also created #10771 as a follow-up to this. |
I'm not sure if there are |
@chrispenny this isn't high impact according to the definition in the docs since it can be worked around pretty easily by implementing some extra methods. |
Lowered the impact, however I had a look at the PR already and merged it now. Released 4.13.1. |
@GuySartorelli @michalkleiner @sabina-talipova can this please be re-opened? The issue has now just moved to the next error (which I mentioned in the description when I attempted to implement a
If this isn't considered I tried adding public function getDefaultSearchContext()
{
return SearchContext::create(
static::class,
FieldList::create(),
[]
);
} But that (again) just kicks the can down the road to the next error:
|
The error you're indicating doesn't happen with the test class I created to mimic the IndexedDocumentResult class, so I'm not sure what's going on there. Have you tried reproducing this in a more simplified scenario? Regardless, I'll try installing that module and reproducing with that.
It's not expected that you'll need these methods. But to work around this bug, you can implement each of the methods that it complains don't exist until it doesn't complain. Note that that's a workaround, not an expected requirement. |
It turns out these errors are actually a result of #10725 - basically, Now, I think for your use case, simply removing the |
@GuySartorelli it looks like removing |
Awesome! I'll close this issue then. |
An issue has been raised on another module: silverstripe/silverstripe-search-service#82
The error is:
The class triggering this error is SearchAdmin.php, and this class displays IndexedDocumentsResult, which are
ViewableData
records (notDataObjects
) in aGridField
.In
4.12
it looks like theGridFieldFilterHeader::canFilterAnyColumns()
method didn't attempt to access thissearchableFields()
method (in fact, no part of this class does):https://github.com/silverstripe/silverstripe-framework/blob/4.12/src/Forms/GridField/GridFieldFilterHeader.php#L251
In
4.13
, it now does:https://github.com/silverstripe/silverstripe-framework/blob/4.13/src/Forms/GridField/GridFieldFilterHeader.php#L254
I attempted to add this
searchableFields()
method toIndexedDocumentsResult
. I tried to returnnull
, an emptyarray
, and tried returning the same fields as itssummaryFields()
method. All of these attempts resulted in different new errors.searchableFields()
returnsnull
:searchableFields()
returns an emptyarray
:searchableFields()
returns the same fields assummaryFields()
:Resolution one
Could
GridFieldFilterHeader
be updated to no longer assume searchable fields are available?Resolution two
Could you please help me figure out what code I need to add to
IndexedDocumentsResult
to add support for searchable fields?PR
The text was updated successfully, but these errors were encountered: