Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 125 lines (95 sloc) 5.037 kb
8b55541 @fabpot added an UPGRADE file
fabpot authored
1 UPGRADE FROM 2.0 to 2.1
2 =======================
3
4 * assets_base_urls and base_urls merging strategy has changed
5
bf5ccb0 @Tobion resolved conflict
Tobion authored
6 Unlike most configuration blocks, successive values for
7 ``assets_base_urls`` will overwrite each other instead of being merged.
8 This behavior was chosen because developers will typically define base
9 URL's for each environment. Given that most projects tend to inherit
10 configurations (e.g. ``config_test.yml`` imports ``config_dev.yml``)
11 and/or share a common base configuration (i.e. ``config.yml``), merging
12 could yield a set of base URL's for multiple environments.
8b55541 @fabpot added an UPGRADE file
fabpot authored
13
74bc699 @fabpot moved management of the locale from the Session class to the Request cla...
fabpot authored
14 * moved management of the locale from the Session class to the Request class
15
bf5ccb0 @Tobion resolved conflict
Tobion authored
16 Configuring the default locale:
74bc699 @fabpot moved management of the locale from the Session class to the Request cla...
fabpot authored
17
bf5ccb0 @Tobion resolved conflict
Tobion authored
18 Before:
74bc699 @fabpot moved management of the locale from the Session class to the Request cla...
fabpot authored
19
bf5ccb0 @Tobion resolved conflict
Tobion authored
20 framework:
21 session:
22 default_locale: fr
74bc699 @fabpot moved management of the locale from the Session class to the Request cla...
fabpot authored
23
bf5ccb0 @Tobion resolved conflict
Tobion authored
24 After:
74bc699 @fabpot moved management of the locale from the Session class to the Request cla...
fabpot authored
25
bf5ccb0 @Tobion resolved conflict
Tobion authored
26 framework:
27 default_locale: fr
74bc699 @fabpot moved management of the locale from the Session class to the Request cla...
fabpot authored
28
bf5ccb0 @Tobion resolved conflict
Tobion authored
29 Retrieving the locale from a Twig template:
74bc699 @fabpot moved management of the locale from the Session class to the Request cla...
fabpot authored
30
bf5ccb0 @Tobion resolved conflict
Tobion authored
31 Before: `{{ app.request.session.locale }}` or `{{ app.session.locale }}`
32 After: `{{ app.request.locale }}`
74bc699 @fabpot moved management of the locale from the Session class to the Request cla...
fabpot authored
33
bf5ccb0 @Tobion resolved conflict
Tobion authored
34 Retrieving the locale from a PHP template:
74bc699 @fabpot moved management of the locale from the Session class to the Request cla...
fabpot authored
35
bf5ccb0 @Tobion resolved conflict
Tobion authored
36 Before: `$view['session']->getLocale()`
37 After: `$view['request']->getLocale()`
74bc699 @fabpot moved management of the locale from the Session class to the Request cla...
fabpot authored
38
bf5ccb0 @Tobion resolved conflict
Tobion authored
39 Retrieving the locale from PHP code:
74bc699 @fabpot moved management of the locale from the Session class to the Request cla...
fabpot authored
40
bf5ccb0 @Tobion resolved conflict
Tobion authored
41 Before: `$session->getLocale()`
42 After: `$request->getLocale()`
2a74ac3 @canni Add info about BC Break to CHANGELOG-2.1 and UPGRADE-2.1
canni authored
43
44 * Method `equals` of `Symfony\Component\Security\Core\User\UserInterface` has
45 moved to `Symfony\Component\Security\Core\User\EquatableInterface`.
46
bf5ccb0 @Tobion resolved conflict
Tobion authored
47 You have to change the name of the `equals` function in your implementation
48 of the `User` class to `isEqualTo` and implement `EquatableInterface`.
49 Apart from that, no other changes are required to make it behave as before.
50 Alternatively, you can use the default implementation provided
51 by `AbstractToken:hasUserChanged` if you do not need any custom comparison logic.
52 In this case do not implement the interface and remove your comparison function.
53
54 Before:
55
56 class User implements UserInterface
57 {
58 // ...
59 public function equals(UserInterface $user) { /* ... */ }
60 // ...
61 }
62
63 After:
64
65 class User implements UserInterface, EquatableInterface
66 {
67 // ...
68 public function isEqualTo(UserInterface $user) { /* ... */ }
69 // ...
70 }
71
43293f4 @webmozart Updated UPGRADED file to reflect changes merged in e056480ab285e424675c4...
webmozart authored
72 * Form children aren't automatically validated anymore. That means that you
73 explicitely need to set the `Valid` constraint in your model if you want to
74 validate associated objects.
bf5ccb0 @Tobion resolved conflict
Tobion authored
75
76 If you don't want to set the `Valid` constraint, or if there is no reference
77 from the data of the parent form to the data of the child form, you can
78 enable BC behaviour by setting the option "cascade_validation" to `true` on
87b16e7 @webmozart [Form] Greatly improved ChoiceListInterface and all of its implementatio...
webmozart authored
79 the parent form.
80
81 * In the template of the choice type, instead of a single "choices" variable
82 there are now two variables: "choices" and "choice_labels".
83 "choices" contains the choices in the values (before they were in the keys)
84 and "choice_labels" contains the matching labels. Both arrays have
85 identical keys.
86
87 Before:
88
89 {% for choice, label in choices %}
90 <option value="{{ choice }}"{% if _form_is_choice_selected(form, choice) %} selected="selected"{% endif %}>
91 {{ label }}
92 </option>
93 {% endfor %}
94
95 After:
96
97 {% for index, choice in choices %}
98 <option value="{{ choice }}"{% if _form_is_choice_selected(form, choice) %} selected="selected"{% endif %}>
99 {{ choice_labels[index] }}
100 </option>
101 {% endfor %}
102
103 * The strategy for generating the HTML attributes "id" and "name"
104 of choices in a choice field has changed. Instead of appending the choice
105 value, a generated integer is now appended by default. Take care if your
106 Javascript relies on that. If you can guarantee that your choice values only
107 contain ASCII letters, digits, letters, colons and underscores, you can
108 restore the old behaviour by setting the option "index_strategy" of the
109 choice field to `ChoiceList::COPY_CHOICE`.
110
111 * The strategy for generating the HTML attributes "value" of choices in a
112 choice field has changed. Instead of using the choice value, a generated
113 integer is now stored. Again, take care if your Javascript reads this value.
114 If your choice field is a non-expanded single-choice field, or if
115 the choices are guaranteed not to contain the empty string '' (which is the
116 case when you added it manually or when the field is a single-choice field
117 and is not required), you can restore the old behaviour by setting the
118 option "value_strategy" to `ChoiceList::COPY_CHOICE`.
119 of choices in a choice field has changed. Instead of appending the choice
120 value, a generated integer is now appended by default. Take care if your
121 Javascript relies on that. If you can guarantee that your choice values only
122 contain ASCII letters, digits, letters, colons and underscores, you can
123 restore the old behaviour by setting the option "index_strategy" of the
124 choice field to `ChoiceList::COPY_CHOICE`.
Something went wrong with that request. Please try again.