Hello, I have an instance of a form, I'm trying to get the default value of the field in the xml, in this case the default value is 0 (zero).
The problem occurs in getFieldAttribute role in "libraries/joomla/form/form.php"
This will return false because the default value is 0
if (($element instanceof SimpleXMLElement) && ((string) $element[$attribute]))
I believe that the correct test would be:
if (($element instanceof SimpleXMLElement) && isset($element[$attribute]))
The correct is to test if the attribute exists.
http://www.widesys.com.br/getFieldAttribute.webm
Thank you
It works as expected.
Thank you
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-01-28 11:27:11 |
Closed_By | ⇒ | brianteeman |
Closing as we have a PR
@widesys Please test this PR #8383 to make sure it works as expected now.