Skip to content

Adding FilterGroupBuilder to customs template creates error message

im trying to add and OR Filter to my template. So i added filtergroupbuilder to the construct. As soons as i add the lines im getting the following error message

__construct(): Argument #8 ($filterGroupBuilder) must be of type MagentoFrameworkApiSearchFilterGroupBuilder

here is my code

    public function __construct(
        MagentoBackendBlockTemplateContext$context,
        MagentoSalesModelOrderRepository$orderRepository,
        MagentoFrameworkApiSearchCriteriaBuilder$searchCriteriaBuilder,
        MagentoFrameworkStdlibDateTimeDateTime$dateTime,
        MagentoFrameworkApiFilterBuilder$filterBuilder,
        MagentoCatalogModelProductRepository$productRepository,
        RecipientStreetRepositoryInterface $recipientStreetRepository,
        MagentoFrameworkApiSearchFilterGroupBuilder $filterGroupBuilder, 
        RecipientStreetLoader $streetLoader,
        BirdSimpleExportHelperData$helper,
        array $data = []

    ) {
        $this->orderRepository = $orderRepository;
        $this->searchCriteriaBuilder = $searchCriteriaBuilder;
        $this->dateTime = $dateTime;
        $this->filterBuilder = $filterBuilder;
        $this->productRepository = $productRepository;
        $this->filterGroupBuilder =$filterGroupBuilder;

removing the lines with filtergroupbuilder makes the template work. any idea what is wrong on it ?