3 All notable changes to this project will be documented in this file, in reverse chronological order by release.
9 - [#194](https://github.com/zendframework/zend-form/pull/194) adds the ability to whitelist additional HTML attributes for use with a view helper,
10 as well as attribute prefixes. These can be enabled via the following:
13 $helper->addValidAttribute('attribute-name');
14 $helper->addValidAttributePrefix('prefix-');
17 - [#188](https://github.com/zendframework/zend-form/pull/188) adds a new method to the `FormElementErrors` view helper, `setTranslateMessages(bool $flag)`.
18 By default, the helper continues to translate error messages (if a translator
19 is present), as introduced in 2.11.0. However, using this method, you can
20 disable translation, which may be necessary to prevent double translation
21 and/or to reduce logs from missed translation lookups. Because the method
22 implements a fluent interface, you may do so in one line:
25 echo $this->formElementErrors()->setTranslateMessages(false);
28 Note: you will need to reset the value afterwards if you want translations to occur
33 - [#193](https://github.com/zendframework/zend-form/pull/193) modifies how attributes are escaped. If zend-espaper raises an exception
34 for an invalid attribute value, helpers will now catch the exception, and use
35 a blank value for the attribute. This prevents 500 errors from being raised
50 ## 2.11.0 - 2017-12-06
54 - [#104](https://github.com/zendframework/zend-form/pull/104) adds the ability
55 for the `FormElementErrors` view helper to translate validation error messages
56 using the composed translator and text domain instances.
58 - [#171](https://github.com/zendframework/zend-form/pull/171),
59 [#186](https://github.com/zendframework/zend-form/pull/186), and
60 [#187](https://github.com/zendframework/zend-form/pull/187) add support for
73 - [#171](https://github.com/zendframework/zend-form/pull/171) removes support
76 - [#186](https://github.com/zendframework/zend-form/pull/186) removes support
81 - [#162](https://github.com/zendframework/zend-form/pull/162) fixes an issue
82 with hydration when a form has called `setWrapElements(true)`, ensuring that
83 binding values in a fieldset will correctly identify the elements in the
86 - [#172](https://github.com/zendframework/zend-form/pull/172) fixes the
87 `DateTime` element such that it no longer attempts to use its
88 `DATETIME_FORMAT` constant, but, rather, the value of the `$format` property,
89 when representing the element; this change allows developers to override the
90 format, which was the original intention.
92 - [#178](https://github.com/zendframework/zend-form/pull/178) loosens the checks
93 in `Zend\Form\Element\DateTime::getValue()` to check against PHP's `DateTimeInterface` (vs
94 `DateTime`) when retrieving the value; this fixes edge cases where it was
95 instead returning the format for `DateTimeImmutable` values.
97 ## 2.10.2 - 2017-05-18
113 - [#161](https://github.com/zendframework/zend-form/pull/161) adds an import
114 statement to the `ElementFactory`, fixing an error whereby checks for
115 `Traversable` creation options would lead to a service creation exception;
116 these now correctly identify traversable options and convert them to an array.
117 - [#164](https://github.com/zendframework/zend-form/pull/164) fixes how the
118 `FormElementManagerFactory` factory initializes the plugin manager instance,
119 ensuring it is injecting the relevant configuration from the `config` service
120 and thus seeding it with configured form/form element services. This means
121 that the `form_elements` configuration will now be honored in non-zend-mvc
123 - [#159](https://github.com/zendframework/zend-form/pull/159) fixes the behavior
124 of the `min` and `max` attributes of the various `DateTime` elements, ensuring
125 that the elements raise an exception during instantiation if the values
126 provided are in a format that `DateTime` does not recognize for the element
129 ## 2.10.1 - 2017-04-26
145 - [#134](https://github.com/zendframework/zend-form/pull/134) fixes how the
146 `FormElementManager` handles invokable classes when the `autoAddInvokableClass`
147 flag is enabled. Previously, it used the built-in utilities from
148 zend-servicemanager, but now correctly uses its own `setInvokableClass()`
149 method, which forces usage of the `ElementFactory` for such classes, and thus
150 ensures the name and options are passed to the element constructor.
151 - [#136](https://github.com/zendframework/zend-form/pull/136) fixes how error
152 messages are provided when an element uses a required `ArrayInput`, but no
153 values are submitted. Previously, no messages were returned; now they are.
154 - [#156](https://github.com/zendframework/zend-form/pull/156) fixes how elements
155 that act as `InputProvider`s are merged into parent `CollectionInputFilter`s;
156 previously, forms did not check if the element was in the target input filter
157 composed in a `CollectionInputFilter`, leading to duplicate elements with
158 varying behavior; now the inputs are correctly merged.
160 ## 2.10.0 - 2017-02-23
164 - [#115](https://github.com/zendframework/zend-form/pull/115) adds translatable
165 HTML attributes to the abstract view helper.
166 - [#116](https://github.com/zendframework/zend-form/pull/116) adds the InputFilterFactory
167 dependency to the constructor.
179 - [#139](https://github.com/zendframework/zend-form/pull/139) adds support for
180 ReCaptcha version 2 though zend-captcha 2.7.1.
182 ## 2.10.0 - 2017-02-23
186 - [#115](https://github.com/zendframework/zend-form/pull/115) adds translatable
187 HTML attributes to the abstract view helper.
188 - [#116](https://github.com/zendframework/zend-form/pull/116) adds the InputFilterFactory
189 dependency to the constructor.
201 - [#139](https://github.com/zendframework/zend-form/pull/139) adds support for
202 ReCaptcha version 2 though zend-captcha 2.7.1.
204 ## 2.9.2 - 2016-09-22
220 - [#122](https://github.com/zendframework/zend-form/pull/122) fixes collection
221 binding following successful validation. The fix introduced in #106, while it
222 corrected the behavior around binding a collection that was not re-submitted,
223 broke behavior around binding submitted collections. #122 corrects the issue,
224 retaining the fix from #106.
226 ## 2.9.1 - 2016-09-14
230 - [#85](https://github.com/zendframework/zend-form/pull/85) adds support for the
231 zend-code 3.0 series (retaining support for the 2.* series).
243 - [#119](https://github.com/zendframework/zend-form/pull/119) fixes the order in
244 which the default initializers are injected into the `FormElementManager`,
245 ensuring that the initializer injecting a factory into a `FormFactoryAware`
246 instance is triggered before the initializer that calls `init()`, and also
247 that the initializer calling `init()` is always triggered last.
248 - [#106](https://github.com/zendframework/zend-form/pull/106) updates behavior
249 around binding collection values to a fieldset or form such that if the
250 collection is not part of the current validation group, its value will not be
251 overwritten with an empty set.
253 ## 2.9.0 - 2016-06-07
257 - [#57](https://github.com/zendframework/zend-form/pull/57) adds new elements,
258 `FormSearch` and `FormTel`, which map to the `FormSearch` and `FormTel` view
271 - Updates the composer suggestions list to remove those that were redundant, and
272 to add explicit constraints and reasons for each listed (e.g., zend-code is
273 required for annotations support).
275 ## 2.8.4 - 2016-06-07
279 - [#74](https://github.com/zendframework/zend-form/pull/74) adds an
280 alias for the `FormTextarea` view helper that is referenced in the
293 - [#77](https://github.com/zendframework/zend-form/pull/77) updates
294 `Zend\Form\View\HelperConfig` to improve performance when running under
295 zend-servicemanager v3.
296 - [#19](https://github.com/zendframework/zend-form/pull/19) provides a thorough
297 fix for an issue when removing all items in a collection associated with a
298 form. Prior to this release, values that existed in the collection persisted
299 when a form submission intended to remove them.
301 ## 2.8.3 - 2016-05-03
305 - [#70](https://github.com/zendframework/zend-form/pull/70) adds and publishes
306 the documentation to https://zendframework.github.io/zend-form/
318 - [#69](https://github.com/zendframework/zend-form/pull/69) fixes aliases in the
319 `FormElementManager` polyfill for zend-servicemanager v2 to ensure they are
320 canonicalized correctly.
322 ## 2.8.2 - 2016-05-01
326 - [#60](https://github.com/zendframework/zend-form/pull/60) adds an alias from
327 `Zend\Form\FormElementManager` to `FormElementManager` in the `ConfigProvider`.
328 - [#67](https://github.com/zendframework/zend-form/pull/67) adds polyfills for
329 the `FormElementManager` to vary its definitions based on the major version of
330 zend-servicemanager in use. `FormElementManagerFactory` was updated to return
331 the specific polyfill version, and an autoload rule was added to alias the
332 class to the correct polyfill version. The polyfills were necessary to ensure
333 that invokable classes are mapped to the new `ElementFactory` introduced in
334 the 2.7 series, thus ensuring instantiation is performed correctly.
346 - [#65](https://github.com/zendframework/zend-form/pull/65) fixes instantiation
347 of `Zend\Form\FormElementManager` to ensure that the default initializers,
348 `injectFactory()` and `callElementInit()` are registered as the first and last
349 initializers, respectively, during construction, restoring the pre-2.7
351 - [#67](https://github.com/zendframework/zend-form/pull/67) fixes the behavior
352 of `Factory::create()` to the pre-2.7.1 behavior of *not* passing creation
353 options when retrieving an instance from the `FormElementManager`. This
354 ensures that options are not passed to Element/Fieldset/Form instances
355 until after they are fully initialized, ensuring that all dependencies are
358 ## 2.8.1 - 2016-04-18
374 - [#59](https://github.com/zendframework/zend-form/pull/59) fixes the
375 `Module::init()` method to properly receive a `ModuleManager` instance, and
376 not expect a `ModuleEvent`.
378 ## 2.8.0 - 2016-04-07
382 - [#53](https://github.com/zendframework/zend-form/pull/53) adds
383 `Zend\Form\FormElementManagerFactory`, for creating and returning instances of
384 `Zend\Form\FormElementManager`. This factory was ported from zend-mvc, and
385 will replace it for version 3 of that component.
386 - [#53](https://github.com/zendframework/zend-form/pull/53) adds
387 `Zend\Form\Annotation\AnnotationBuilderFactory`, for creating and returning
388 instances of `Zend\Form\Annotation\AnnotationBuilder`. This factory was ported
389 from zend-mvc, and will replace it for version 3 of that component.
390 - [#53](https://github.com/zendframework/zend-form/pull/53) exposes the package
391 as a config-provider and ZF component, by adding:
392 - `ConfigProvider`, which maps the `FormElementsManager` and
393 `FormAnnotationBuilder` servies previously provided by zend-mvc; the form
394 abstract factory as previously registered by zend-mvc; and all view helper
396 - `Module`, which maps services and view helpers per the `ConfigProvider`, and
397 provides configuration to the zend-modulemanager `ServiceLocator` in order
398 for modules to provide form and form element configuration.
402 - [#53](https://github.com/zendframework/zend-form/pull/53) deprecates
403 `Zend\Form\View\HelperConfig`; the functionality is made obsolete by
404 `ConfigProvider`. It now consumes the latter in order to provide view helper
415 ## 2.7.1 - 2016-04-07
431 - [#24](https://github.com/zendframework/zend-form/pull/24) ensures that when
432 `Zend\Form\Form::getInputFilter()` when lazy-creates an `InputFilter`
433 instance, it is populated with the `InputFilterFactory` present in its own
434 `FormFactory`. This ensures that any custom inputs, input filters, validators,
435 or filters are available to the new instance.
436 - [#38](https://github.com/zendframework/zend-form/pull/38) removes the
437 arbitrary restriction of only the "labelledby" and "describedby" aria
438 attributes on form element view helpers; any aria attribute is now allowed.
439 - [#45](https://github.com/zendframework/zend-form/pull/45) fixes the behavior
440 in `Zend\Form\Factory::create()` when pulling elements from the form element
441 manager; it now will pass specifications provided for the given element when
442 calling the manager's `get()` method.
444 ## 2.7.0 - 2016-02-22
460 - [#40](https://github.com/zendframework/zend-form/pull/40) and
461 [#43](https://github.com/zendframework/zend-form/pull/43) prepare the
462 component to be forwards compatible with each of the following:
463 - zend-eventmanager v3
465 - zend-servicemanager v3
467 - [#14](https://github.com/zendframework/zend-form/pull/14) ensures that
468 collections can remove all elements when populating values.
470 ## 2.6.0 - 2015-09-22
474 - [#17](https://github.com/zendframework/zend-form/pull/17) updates the component
475 to use zend-hydrator for hydrator functionality; this provides forward
476 compatibility with zend-hydrator, and backwards compatibility with
477 hydrators from older versions of zend-stdlib.
491 ## 2.5.3 - 2015-09-22
507 - [#16](https://github.com/zendframework/zend-form/pull/16) updates the
508 zend-stdlib dependency to reference `>=2.5.0,<2.7.0` to ensure hydrators
509 will work as expected following extraction of hydrators to the zend-hydrator
512 ## 2.5.2 - 2015-09-09
520 - [#12](https://github.com/zendframework/zend-form/pull/12) deprecates the
521 `AllowEmpty` and `ContinueIfEmpty` annotations, to mirror changes made in
522 [zend-inputfilter#26](https://github.com/zendframework/zend-inputfilter/pull/26).
530 - [#1](https://github.com/zendframework/zend-form/pull/1) `AbstractHelper` was
531 being utilized on the method signature vs. `HelperInterface`.
532 - [#9](https://github.com/zendframework/zend-form/pull/9) fixes typos in two
533 `aria` attribute names in the `AbstractHelper`.