?
Referenced as Pull Request for: # 8383
avatar widesys
widesys
11 Nov 2015

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

avatar widesys widesys - open - 11 Nov 2015
avatar izharaazmi izharaazmi - reference | 51c9c21 - 11 Nov 15
avatar izharaazmi izharaazmi - reference | 3f26c3b - 11 Nov 15
avatar izharaazmi
izharaazmi - comment - 11 Nov 2015

@widesys Please test this PR #8383 to make sure it works as expected now.

avatar widesys
widesys - comment - 19 Nov 2015

It works as expected.
Thank you


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8381.

avatar brianteeman brianteeman - change - 28 Jan 2016
Status New Closed
Closed_Date 0000-00-00 00:00:00 2016-01-28 11:27:11
Closed_By brianteeman
avatar brianteeman brianteeman - close - 28 Jan 2016
avatar brianteeman brianteeman - close - 28 Jan 2016
avatar brianteeman
brianteeman - comment - 28 Jan 2016

Closing as we have a PR


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8381.

Add a Comment

Login with GitHub to post a comment