Skip to content

Commit 6302d29

Browse files
authored
Merge pull request mautic#15255 from andersonjeccel/forms-disable-search-indexing-by-default
Forms: Set "Disable search indexing" as enabled by default
2 parents 4647c9d + 3f76382 commit 6302d29

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

app/bundles/FormBundle/Entity/Form.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ public function __construct()
165165
$this->fields = new ArrayCollection();
166166
$this->actions = new ArrayCollection();
167167
$this->submissions = new ArrayCollection();
168+
$this->noIndex = true;
168169
$this->initializeProjects();
169170
}
170171

app/bundles/FormBundle/Form/Type/FormType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
136136
YesNoButtonGroupType::class,
137137
[
138138
'label' => 'mautic.form.form.no_index',
139-
'data' => $options['data']->getNoIndex() ?: false,
139+
'data' => $options['data']->getNoIndex(),
140140
]
141141
);
142142

app/bundles/FormBundle/Tests/Entity/FormTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ public function testSetNoIndex($value, $expected, array $changes): void
2222

2323
public static function setNoIndexDataProvider(): iterable
2424
{
25-
yield [null, null, []];
26-
yield [true, true, ['noIndex' => [null, true]]];
27-
yield [false, false, ['noIndex' => [null, false]]];
28-
yield ['', false, ['noIndex' => [null, false]]];
29-
yield [0, false, ['noIndex' => [null, false]]];
30-
yield ['string', true, ['noIndex' => [null, true]]];
25+
yield [null, null, ['noIndex' => [true, null]]];
26+
yield [true, true, []];
27+
yield [false, false, ['noIndex' => [true, false]]];
28+
yield ['', false, ['noIndex' => [true, false]]];
29+
yield [0, false, ['noIndex' => [true, false]]];
30+
yield ['string', true, []];
3131
}
3232

3333
public function testGetMappedFieldValues(): void

0 commit comments

Comments
 (0)