Skip to content

Commit 77cae83

Browse files
committed
Merge branch '4.2'
* 4.2: Explicitly list _field-name_entry_parts Improve add to collection JS exemple Update the email address related to the Code of Conduct feat(encore): ide integration Update testing.rst
2 parents aac5cf6 + 724d85c commit 77cae83

File tree

5 files changed

+39
-6
lines changed

5 files changed

+39
-6
lines changed

contributing/code_of_conduct/care_team.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Members
1919

2020
Here are all the members of the Code of Conduct CARE team (in alphabetic order).
2121
You can contact any of them directly using the contact details below or you can
22-
also contact all of them at once by emailing **coc@symfony.com**:
22+
also contact all of them at once by emailing **care@symfony.com**:
2323

2424
* **Emilie Lorenzo**
2525

email/testing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Start with a simple controller action that sends an email::
2222

2323
$mailer->send($message);
2424

25-
return $this->render(...);
25+
// ...
2626
}
2727

2828
In your functional test, use the ``swiftmailer`` collector on the profiler

form/form_themes.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,8 @@ Fragment Naming for Collections
309309
When using a :doc:`collection of forms </form/form_collections>`, the fragment
310310
of each collection item follows the pattern ``_field-name_entry_part``. For
311311
example, if your form field is named ``tasks``, the fragment for each task will
312-
be named ``_tasks_entry`` (``_tasks_entry_label``, ``_tasks_entry_label``, etc.)
312+
be named ``_tasks_entry`` (``_tasks_entry_row``, ``_tasks_entry_label``,
313+
``_tasks_entry_widget``, ``_tasks_entry_error``)
313314

314315
Template Fragment Inheritance
315316
.............................

frontend/encore/faq.rst

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,3 +137,34 @@ Babel. But, you can change that via the ``configureBabel()`` method. See
137137
:doc:`/frontend/encore/babel` for details.
138138

139139
.. _`rsync`: https://rsync.samba.org/
140+
141+
How Do I Integrate my Encore Configuration with my IDE?
142+
-------------------------------------------------------
143+
144+
`Webpack integration in PhpStorm`_ and other IDEs makes your development more
145+
productive (for example by resolving aliases). However, you may face this error:
146+
147+
.. code-block:: text
148+
149+
Encore.setOutputPath() cannot be called yet because the runtime environment
150+
doesn't appear to be configured. Make sure you're using the encore executable
151+
or call Encore.configureRuntimeEnvironment() first if you're purposely not
152+
calling Encore directly.
153+
154+
It fails because the Encore Runtime Environment is only configured when you are
155+
running it (e.g. when executing ``yarn encore dev``). Fix this issue calling to
156+
``Encore.isRuntimeEnvironmentConfigured()`` and
157+
``Encore.configureRuntimeEnvironment()`` methods:
158+
159+
.. code-block:: javascript
160+
161+
// webpack.config.js
162+
const Encore = require('@symfony/webpack-encore')
163+
164+
if (!Encore.isRuntimeEnvironmentConfigured()) {
165+
Encore.configureRuntimeEnvironment(process.env.NODE_ENV || 'dev');
166+
}
167+
168+
// ... the rest of the Encore configuration
169+
170+
.. _`Webpack integration in PhpStorm`: https://www.jetbrains.com/help/phpstorm/using-webpack.html

reference/forms/types/collection.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ you need is this JavaScript code:
149149
// add-collection-widget.js
150150
jQuery(document).ready(function () {
151151
jQuery('.add-another-collection-widget').click(function (e) {
152-
var list = jQuery(jQuery(this).attr('data-list'));
152+
var list = jQuery(jQuery(this).attr('data-list-selector'));
153153
// Try to find the counter of the list or use the length of the list
154154
var counter = list.data('widget-counter') | list.children().length;
155155
@@ -180,7 +180,8 @@ And update the template as follows:
180180
{# store the prototype on the data-prototype attribute #}
181181
<ul id="email-fields-list"
182182
data-prototype="{{ form_widget(form.emails.vars.prototype)|e }}"
183-
data-widget-tags="{{ '<li></li>'|e }}">
183+
data-widget-tags="{{ '<li></li>'|e }}"
184+
data-widget-counter="{{ form.children|length }}">
184185
{% for emailField in form.emails %}
185186
<li>
186187
{{ form_errors(emailField) }}
@@ -191,7 +192,7 @@ And update the template as follows:
191192
192193
<button type="button"
193194
class="add-another-collection-widget"
194-
data-list="#email-fields-list">Add another email</button>
195+
data-list-selector="#email-fields-list">Add another email</button>
195196

196197
{# ... #}
197198
{{ form_end(form) }}

0 commit comments

Comments
 (0)