Skip to content

Commit

Permalink
fix(metadata): no deprecation when elasticsearch is null (#5499)
Browse files Browse the repository at this point in the history
  • Loading branch information
dannyvw authored Mar 31, 2023
1 parent 871824c commit aa2dfe7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function create(string $resourceClass): ResourceMetadataCollection
: 'You will have to remove it when upgrading to v4';
trigger_deprecation('api-platform/core', '3.1', sprintf('Setting "elasticsearch" in Operation is deprecated. %s', $solution));
}
if ($this->hasIndices($operation)) {
if (null !== $elasticsearch && $this->hasIndices($operation)) {
$operation = $operation->withElasticsearch(true);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public function elasticsearchProvider(): array
{
return [
'elasticsearch: false' => [false, 0, false],
'elasticsearch: null' => [null, 1, false],
'elasticsearch: null' => [null, 0, false],
'elasticsearch: true' => [true, 1, true],
];
}
Expand Down

0 comments on commit aa2dfe7

Please sign in to comment.