Cannot read property 'dataField' of null at getCompositeAggsQuery
Affected Projects React
Library Version: 3.12.4
Describe the bug
I add aggregationField prop to ReactiveList and I get this error:
Uncaught TypeError: Cannot read property 'dataField' of null at getCompositeAggsQuery (helper.js:formatted:535)
To Reproduce
Steps to reproduce the behavior:
Just add a ReactiveList component with aggregationField prop. It will throw the error.
Expected behavior
should not throw error
Additional context
The issue that I found is that the ReactiveList component calls the getCompositeAggsQuery function with an incorrect signature when compared to the getCompositeAggsQuery function that comes from reactive core.
Here is what the ReactiveList call looks like:
getAggsQuery = () => {
const { size, aggregationField, afterKey } = this.props;
const queryOptions = { size };
if (aggregationField) {
queryOptions.aggs = getCompositeAggsQuery(
{},
this.props,
afterKey ? { after: afterKey } : null,
true,
).aggs;
}
return queryOptions;
};
Here is what the getCompositeAggsQuery function signature looks like from reactive core:
export const getCompositeAggsQuery = (value, query, props, after, showTopHits = false) => {
As you can see the signatures are not compatible. The props argument is not lining up and we get the error
The same bug occurs in ReactiveComponent, CategorySearch, DataSearch web components
I'm also encountering this with version 3.13.0.
Any updates? Any idea which version works with aggregationField?
Bump! How is this not prioritized?
@infinitodk This issue has been fixed in v3.13.2.