Open Vilsafur opened 4 years ago
For our working custom filter, the differences I see are your arguments to the base service App\Filter\CritereFilter.
arguments:
$managerRegistry: '@doctrine'
$requestStack: null
$iriConverter: '@api_platform.iri_converter'
$propertyAccessor: '@api_platform.property_accessor'
$logger: '@logger'
$identifiersExtractor: '@api_platform.identifiers_extractor.cached'
$nameConverter: '@api_platform.name_converter'
Thank you for that answer, but after trying, it doesn't work.
The filter doesn't appear.
You don't need the constructor in your class unless you are doing some logic there with the parameters. Don't see an apply() or getDescription() method there, so I assumed you just stripped them out for the issue post.
"Doesn't appear" sounds like you don't have a description for the filter class.
Does bin/console cache:clear
report any errors? api-platform silently ignores filters that don't load for some reason.
Sorry for the late reply.
Unfortunnately, it's same.
I don't have apply() or getDescription() methods because I extend of SearchFilter class who have this methods.
The command bin/console cache:clear
have no error and, in log, I don't have ignored filters.
It's just like i don't have filter.
In your actual service declaration, do you have the same property name as in the annotation declaration?
entity.critereFilter:
parent: 'App\Filter\CritereFilter'
tags: [ { name: 'api_platform.filter', id: 'entity.critereFilter' } ]
arguments:
$properties:
'garanties.franchise': "exact"
autowire: false
autoconfigure: false
Hi,
I've create a custom filter. It's working when I implement him with annotation but not when implementing in YAML (with or without
App\Filter\CritereFilter
declaration).The SearchFilter working in YAML and Annotation.
The Yaml implementation :
The Annotation implementation:
Have you an idea what's wrong with the YAML's configuration ?