- Tested on PHP 8.2 and 8.3
- psalm version 5 is used for static analysis, fixed new-found issues
- JS generated by
Length
rule now checks whether an element's value itself is empty, not itslength
property - Added missing getter methods for existing setters:
\HTML_QuickForm2_Element_Button::getContent()
\HTML_QuickForm2_Element_Static::getTagName()
- PEAR package of version 2.3.0 was accidentally created with
require_once
statements disabled (see issue #9)
- Upgraded tests, PHPUnit Polyfills package is used to run them on PHP 5.6 to PHP 8.1
- Test suite now runs on GitHub Actions rather than on Travis
- The package runs under PHP 8.1 without
E_DEPRECATED
messages (see issue #6) - Use psalm for static analysis
- Minimum required PHP version is now 5.6
- Incorrect option name used in
HTML_QuickForm2_Element_Script::__toString()
. Thanks to Julian Striegl (striegljulian at gmail dot com) for reporting
- Depend on newer HTML_Common2 that does not cause problems with optimized composer autoloader, see GitHub issue #4
- Consistently use
HTML_Common2::OPTION_*
constants for document-wide option names, define and use additionalHTML_QuickForm2_Node::OPTION_*
constants instead of directly using'language'
,'id_force_append_index'
and'nonce'
strings
- Minimum required PHP version is now 5.4
- Removed support for magic_quotes_gpc, as
get_magic_quotes_gpc()
was deprecated in PHP 7.4 and the functionality itself was disabled since PHP 5.4 (GitHub issue #3) HTML_QuickForm2_Element_Date::setValue()
will now accept an instance ofDateTimeInterface
, not onlyDateTime
-
HTML_QuickForm2 runs under PHP 7.2+ without warnings / "deprecated" messages
-
Tests run correctly on PHPUnit versions up to 5
-
It is possible to automatically add
nonce
attributes to inline<script>
tags, just callHTML_Common2::setOption('nonce', $someNonceValue);
before outputting the form. This allows running HTML_QuickForm2 with reasonable Content-Security-Policy
-
Bundled a separate
LICENSE
file instead of having it in each .php file header. Updated phrasing and links to mention 3-Clause BSD license the package actually uses.
When installing with composer, files no longer contain require_once
calls
and 'include-path'
option is not used. The package is now 100% autoloader
compatible, all classes reside in separate files.
Bug #20295 was incorrectly fixed for Static elements, this led to removing their contents when DataSources did not contain values for them.
This is the first release installable with composer, changelogs for older versions
are available in package.xml
file or on PEAR website
Bug fixes
- When using
HTML_QuickForm2_DataSource_Array
and its descendants elements'updateValue()
implementations now differentiate between "no value available for an element" and "explicit null value provided for an element" (see bug #20295). Custom DataSources may implement the newHTML_QuickForm2_DataSource_NullAware
interface to achieve the same. - Contents of Static elements added to Repeat are no longer cleared (bug #19802)
- Client-side rules for containers within Repeat are correctly removed when removing a repeated item (bug #19803)
- Client-side validator is always generated for a form with a Repeat having some client-side rules on its child elements, even if Repeat is empty
- Unit tests updated to work with newer PHPUnit, prevent running tests twice under some circumstances (see bug #19038)
Other features and changes
- Calling
HTML_QuickForm2_Container_Group::setValue()
will clear values of those grouped elements that do not have a corresponding key in the passed array. Passing a null or an empty array tosetValue()
will clear the values of all grouped elements. Previous behaviour was counter-intuitive. - Added
HTML_QuickForm2_Element_Select::getOptionContainer()
(request #19955) HTML_QuickForm2_Container_Group::setValue()
properly handles a group of radio elements (request #20103)HTML_QuickForm2_Element_Date::setValue()
can accept an instance of DateTime- Extracted
removeErrorMessage()
fromremoveRelatedErrors()
ofqf.Validator
for easier customizing of client-side errors output