Open okoram opened 2 months ago
I have re-checked all these variants and the problem only occurs in one case:
Element::setAttribute('novalidate', '')
Element::setAttribute('novalidate', '')
rendered as novalidate="", which meant TRUE
Element::setAttribute('novalidate', '')
renders nothing, which means FALSE
In my opinion, this change should be marked as "Breaking Changes".
We follow semantic versioning, so breaking changes are only allowed in a new major version. The change was made to ensure consistent handling of the boolean attributes. For example, if you run frontend tests or use the empty string as a value, this can lead to problems. Therefore the question if there was a concrete problem in your application?
Thanks in advance! 👍
BC Break Report
Summary
There is a problem with the operation of the novalidate attribute after a change: https://github.com/laminas/laminas-form/pull/273
According to the documentation: https://html.spec.whatwg.org/#attr-fs-novalidate
Therefore, it does not matter what value is assigned to the novalidate attribute. As long as this attribute is present, it is treated as TRUE - the form is not to be validated.
This change has therefore reversed the condition's behavior in all cases except one:
Element::setAttribute('novalidate', true)
In my opinion, this change should be marked as "Breaking Changes".
Previous behavior
novalidate novalidate="" novalidate="novalidate" novalidate="anything" etc. are always TRUE.
Element::setAttribute('novalidate', 'anything')
rendered as novalidate="anything", which meant TRUECurrent behavior
Element::setAttribute('novalidate', 'anything')
renders nothing, which means FALSE