User tests: Successful: Unsuccessful:
It seems that property_exists
has different behavior at PHP HHVM, when work with XML object.
This make Joomla! fail in a lot of places where JFormField::getAttribute()
in use.
You need PHP HHVM installed.
Then run next code:
JFormHelper::loadFieldClass('text');
$field = new JFormFieldText();
$field->setup(new SimpleXMLElement('<field type="text" label="Text" drink="beer"/>'), '');
var_dump($field->getAttribute('drink'));
var_dump($field->getAttribute('food'));
"beer"
null
null
null
none
Category | ⇒ | Libraries |
Status | New | ⇒ | Pending |
Are you sure, that ->name
always exists? perhaps: isset(...)
@bembelimen it is XML object there can exist any
but I need to update it to check for null
Labels |
Added:
?
|
ok, I have made update to make sure attribute exists
I have tested this item
I ran the existing unit tests on HHVM 3.18.5 to test for this issue, nothing came up.
Looks like we should implement a new unit test to validate the issue and the fix.
Looking at the code again, this is a good standard code simplification.
Should move forward with this PR, no additional unit tests should be needed.
@photodude can you please mark your Test as successfully (if you comment means this)?
@franz-wohlkoenig Tested just by code review.
With a structural change like this we probably should have an actual test on a site to verify that JFormField::getAttribute() is working as expected (although I have no expectation of any issues from this change).
@photodude You can test it in your own php and check if everything is OK. I will be enough.
I have tested this item
Installed patch via the patch tester and checked random forms on J3.8.3 in php 5.6
No problems, everything works as expected.
Status | Pending | ⇒ | Ready to Commit |
RTC
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-01-16 22:50:34 |
Closed_By | ⇒ | mbabker | |
Labels |
Added:
?
|
@Fedik no need for future HHVM related PR's They are only going to support Hack lang from now on
https://hhvm.com/blog/2017/09/18/the-future-of-hhvm.html
I have tested this item✅ successfully on 203424c
Test is OK, I tested on local php 7.0 and and other versions at http://sandbox.onlinephpfunctions.com/ and https://3v4l.org/ with code: