PrestaShop / example-modules

Example PrestaShop modules
Academic Free License v3.0
177 stars 118 forks source link

Use TranslateType with FormattedTextareaType #125

Closed micka-fdz closed 1 year ago

micka-fdz commented 2 years ago
Questions Answers
Description? If you wish to use FormattedTextareaType as type, your base type must be TranslateType instead of TranslatableType. Do not forget to add the option hideTabs at true if you want to display the languages list above the WYSIWYG (source : https://devdocs.prestashop-project.org/8/development/components/form/types-reference/translatable/).
Type? improvement
BC breaks? no
Deprecations? no
Fixed ticket? Fixes https://github.com/PrestaShop/example-modules/issues/126.
How to test? -
Possible impacts? -
micka-fdz commented 2 years ago

Ping @matthieu-rolland @Progi1984 (my PRs mentors) for little review 🙏

leemyongpakvn commented 2 years ago

@micka-fdz It looks like we need to fix the docs' notice, not the module code. Because when I use TranslateType instead TranslatableType in module code, the textarea totally disappears, even with additional use PrestaShopBundle\Form\Admin\Type\TranslateType; at top.

matthieu-rolland commented 2 years ago

@micka-fdz It looks like we need to fix the docs' notice, not the module code. Because when I use TranslateType instead TranslatableType in module code, the textarea totally disappears, even with additional use PrestaShopBundle\Form\Admin\Type\TranslateType; at top.

I think you're probably right (@micka-fdz see my question)

kpodemski commented 1 year ago

It is not required anymore. We need to update the docs because the form works correctly without using TranslateType.