Skip to content

Commit

Permalink
bug #2813 Fix text_editor and code_editor HTML input name (yceruto)
Browse files Browse the repository at this point in the history
This PR was merged into the 2.0.x-dev branch.

Discussion
----------

Fix text_editor and code_editor HTML input name

Fixes #2811

For single forms without parent, the variable `name` is equal to `full_name` (e.g. `description`), but for compound forms `full_name` will contain also the name of the parent form (e.g. `product[description]`).

Commits
-------

5e8902e Fix text_edit and code_edit HTML input name
  • Loading branch information
javiereguiluz committed Jul 3, 2019
2 parents 1ccfd7b + 5e8902e commit e7026f5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Resources/views/form/bootstrap_4.html.twig
Expand Up @@ -478,7 +478,7 @@

{# EasyAdmin's CodeEditor form type #}
{% block easyadmin_code_editor_widget %}
<textarea id="{{ id }}" name="{{ name }}" data-easyadmin-code-editor data-language="{{ language }}" data-tab-size="{{ tabSize }}" data-indent-with-tabs="{{ indentWithTabs ? 'true' : 'false' }}" data-js-url="{{ asset("bundles/easyadmin/form-type-code-editor.js") }}" data-css-url="{{ asset("bundles/easyadmin/form-type-code-editor.css") }}">{{ data }}</textarea>
<textarea id="{{ id }}" name="{{ full_name }}" data-easyadmin-code-editor data-language="{{ language }}" data-tab-size="{{ tabSize }}" data-indent-with-tabs="{{ indentWithTabs ? 'true' : 'false' }}" data-js-url="{{ asset("bundles/easyadmin/form-type-code-editor.js") }}" data-css-url="{{ asset("bundles/easyadmin/form-type-code-editor.css") }}">{{ data }}</textarea>

{% if height is not null %}
<style type="text/css">
Expand All @@ -489,7 +489,7 @@
{# EasyAdmin's TextEditor form type #}
{% block easyadmin_text_editor_widget %}
<input id="{{ id }}" value="{{ data }}" type="hidden" name="{{ name }}">
<input id="{{ id }}" value="{{ data }}" type="hidden" name="{{ full_name }}">
<div class="easyadmin-text-editor-wrapper">
<trix-editor input="{{ id }}" data-js-url="{{ asset("bundles/easyadmin/form-type-text-editor.js") }}" data-css-url="{{ asset("bundles/easyadmin/form-type-text-editor.css") }}"></trix-editor>
</div>
Expand Down

0 comments on commit e7026f5

Please sign in to comment.