protected function LingotekNodeNestedTranslatableParagraphsAsymmetricTranslationTest::setFormDisplaysToAsymmetric in Lingotek Translation 3.8.x
Same name and namespace in other branches
- 8.2 tests/src/Functional/LingotekNodeNestedTranslatableParagraphsAsymmetricTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeNestedTranslatableParagraphsAsymmetricTranslationTest::setFormDisplaysToAsymmetric()
- 4.0.x tests/src/Functional/LingotekNodeNestedTranslatableParagraphsAsymmetricTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeNestedTranslatableParagraphsAsymmetricTranslationTest::setFormDisplaysToAsymmetric()
- 3.1.x tests/src/Functional/LingotekNodeNestedTranslatableParagraphsAsymmetricTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeNestedTranslatableParagraphsAsymmetricTranslationTest::setFormDisplaysToAsymmetric()
- 3.2.x tests/src/Functional/LingotekNodeNestedTranslatableParagraphsAsymmetricTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeNestedTranslatableParagraphsAsymmetricTranslationTest::setFormDisplaysToAsymmetric()
- 3.3.x tests/src/Functional/LingotekNodeNestedTranslatableParagraphsAsymmetricTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeNestedTranslatableParagraphsAsymmetricTranslationTest::setFormDisplaysToAsymmetric()
- 3.4.x tests/src/Functional/LingotekNodeNestedTranslatableParagraphsAsymmetricTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeNestedTranslatableParagraphsAsymmetricTranslationTest::setFormDisplaysToAsymmetric()
- 3.5.x tests/src/Functional/LingotekNodeNestedTranslatableParagraphsAsymmetricTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeNestedTranslatableParagraphsAsymmetricTranslationTest::setFormDisplaysToAsymmetric()
- 3.6.x tests/src/Functional/LingotekNodeNestedTranslatableParagraphsAsymmetricTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeNestedTranslatableParagraphsAsymmetricTranslationTest::setFormDisplaysToAsymmetric()
- 3.7.x tests/src/Functional/LingotekNodeNestedTranslatableParagraphsAsymmetricTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeNestedTranslatableParagraphsAsymmetricTranslationTest::setFormDisplaysToAsymmetric()
1 call to LingotekNodeNestedTranslatableParagraphsAsymmetricTranslationTest::setFormDisplaysToAsymmetric()
File
- tests/
src/ Functional/ LingotekNodeNestedTranslatableParagraphsAsymmetricTranslationTest.php, line 29
Class
- LingotekNodeNestedTranslatableParagraphsAsymmetricTranslationTest
- Tests translating a node with multiple locales including translatable nested paragraphs configured with the asymmetric widget.
Namespace
Drupal\Tests\lingotek\FunctionalCode
protected function setFormDisplaysToAsymmetric() : void {
/** @var \Drupal\Core\Entity\Display\EntityFormDisplayInterface[] $formDisplays */
$formDisplays = EntityFormDisplay::loadMultiple();
foreach ($formDisplays as $formDisplay) {
$components = $formDisplay
->getComponents();
$toSave = FALSE;
foreach ($components as $id => $component) {
if (isset($component['type']) && $component['type'] === 'entity_reference_paragraphs') {
$component['type'] = 'paragraphs_classic_asymmetric';
$formDisplay
->setComponent($id, $component);
$toSave = TRUE;
}
}
if ($toSave) {
$formDisplay
->save();
}
}
}