Skip to content

Commit

Permalink
fix repository name when number
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanediondev committed Sep 25, 2023
1 parent 935dd91 commit 0a611f4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Form/Type/ElasticsearchSnapshotType.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
if ('create' == $options['context']) {
if ($form->has('repository') && $form->has('name')) {
if ($form->get('repository')->getData() && $form->get('name')->getData()) {
$snapshot = $this->elasticsearchSnapshotManager->getByNameAndRepository($form->get('name')->getData(), $form->get('repository')->getData());
$snapshot = $this->elasticsearchSnapshotManager->getByNameAndRepository($form->get('name')->getData(), strval($form->get('repository')->getData()));

if ($snapshot) {
$form->get('name')->addError(new FormError(
Expand Down
2 changes: 1 addition & 1 deletion src/Model/ElasticsearchRepositoryModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public function setSettings(?array $settings): self
public function convert(?array $repository): self
{
if (true === isset($repository['name'])) {
$this->setName($repository['name']);
$this->setName(strval($repository['name']));
}

if (true === isset($repository['type'])) {
Expand Down
2 changes: 1 addition & 1 deletion src/Model/ElasticsearchSnapshotModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public function convert(?array $snapshot): self
}

if (true === isset($snapshot['repository'])) {
$this->setRepository($snapshot['repository']);
$this->setRepository(strval($snapshot['repository']));
}

if (true === isset($snapshot['version'])) {
Expand Down

0 comments on commit 0a611f4

Please sign in to comment.