? ? Pending

User tests: Successful: Unsuccessful:

avatar esedic
esedic
13 Apr 2017

Pull Request for Issue #15287.

When you create certain types of fields (tested on list and checkbox fields) and text/values have special characters like accents, you will get a warning when editing an article. See #15287 for details.

This PR adds html_entity_decode() function to SimpleXMLElement string.

Pull Request for Issue # .

Summary of Changes

Testing Instructions

Expected result

Actual result

Documentation Changes Required

avatar esedic esedic - open - 13 Apr 2017
avatar esedic esedic - change - 13 Apr 2017
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 13 Apr 2017
Category Libraries
avatar franz-wohlkoenig franz-wohlkoenig - test_item - 14 Apr 2017 - Tested successfully
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 14 Apr 2017

I have tested this item successfully on 5284d05


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

avatar joomla-cms-bot joomla-cms-bot - change - 14 Apr 2017
Title
[com_fields] Fix for issue #15287
[fields] Fix for issue #15287
avatar joomla-cms-bot joomla-cms-bot - edited - 14 Apr 2017
avatar franz-wohlkoenig franz-wohlkoenig - change - 14 Apr 2017
Category Libraries com_fields Libraries
avatar franz-wohlkoenig franz-wohlkoenig - change - 14 Apr 2017
Title
[fields] Fix for issue #15287
[com_fields] Fix for issue #15287
avatar joomla-cms-bot joomla-cms-bot - change - 14 Apr 2017
Category Libraries com_fields Libraries
avatar franz-wohlkoenig franz-wohlkoenig - change - 14 Apr 2017
Title
[fields] Fix for issue #15287
[com_fields] Fix for issue #15287
Easy No Yes
avatar franz-wohlkoenig franz-wohlkoenig - change - 14 Apr 2017
Category Libraries com_fields Libraries
avatar franz-wohlkoenig franz-wohlkoenig - change - 14 Apr 2017
Title
[com_fields] Fix for issue #15287
[com_fields] Custom fields doesn't work with accents Fix for issue #15287
avatar joomla-cms-bot joomla-cms-bot - edited - 14 Apr 2017
avatar joomla-cms-bot joomla-cms-bot - change - 14 Apr 2017
Category Libraries com_fields Libraries
avatar franz-wohlkoenig franz-wohlkoenig - change - 14 Apr 2017
Category Libraries com_fields Libraries
avatar laoneo
laoneo - comment - 14 Apr 2017

I would not do that in JForm itself but on the place where the load function is called. I'm not sure if the change on JForm will have some unpredictable side effects.

avatar esedic
esedic - comment - 14 Apr 2017

@laoneo, I was thinking about that, if this is the right place to decode form data, but my backend knowledge is limited, I would need a little guidance here. Where is the load function called?

avatar joomla-cms-bot joomla-cms-bot - change - 14 Apr 2017
Category Libraries com_fields Libraries
avatar laoneo
laoneo - comment - 14 Apr 2017

It's in the FieldsHelper::renderForm function.

avatar esedic
esedic - comment - 14 Apr 2017

I can't find renderForm function in administrator/com_fields/helpers/fields.php file. Did you mean function render()?

avatar esedic esedic - change - 15 Apr 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - change - 15 Apr 2017
Category Libraries
avatar joomla-cms-bot joomla-cms-bot - change - 15 Apr 2017
Category Administration com_fields
avatar esedic
esedic - comment - 15 Apr 2017

Ok, I hope I got it right, after making a change in helper file warning is gone. Change in JForm was reverted.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 16 Apr 2017

@esedic is PR ready for Retest?

avatar laoneo
laoneo - comment - 16 Apr 2017

Looks good for me

avatar Quy Quy - test_item - 16 Apr 2017 - Tested unsuccessfully
avatar Quy
Quy - comment - 16 Apr 2017

I have tested this item 🔴 unsuccessfully on e7b203a

Not this value R&B does not work.

PHP Warning:  SimpleXMLElement::__construct(): Entity: line 2: parser error : EntityRef: expecting ';' in \joomla-cms-staging\libraries\joomla\form\form.php on line 728

PHP Warning:  SimpleXMLElement::__construct(): hint="" required="false" readonly="false" validate="options"><option value="R&B in \joomla-cms-staging\libraries\joomla\form\form.php on line 728

PHP Warning:  SimpleXMLElement::__construct(): ^ in \joomla-cms-staging\libraries\joomla\form\form.php on line 728

PHP Warning:  SimpleXMLElement::__construct(): Entity: line 2: parser error : EntityRef: expecting ';' in \joomla-cms-staging\libraries\joomla\form\form.php on line 728

PHP Warning:  SimpleXMLElement::__construct(): ="" required="false" readonly="false" validate="options"><option value="R&B">R&B in \joomla-cms-staging\libraries\joomla\form\form.php on line 728

PHP Warning:  SimpleXMLElement::__construct(): ^ in \joomla-cms-staging\libraries\joomla\form\form.php on line 728

This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/15294.
avatar Quy
Quy - comment - 25 Apr 2017

I think I have a solution. Change htmlentities to htmlspecialchars in the following 2 lines:

https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_fields/libraries/fieldslistplugin.php#L44-L45

No more errors with the values: A&B and Manuel Gómez Padilla.

I don't know if it requires , ENT_COMPAT, 'UTF-8' with htmlspecialchars or something else. If someone knows, please submit a pull request. Thanks.

avatar esedic
esedic - comment - 25 Apr 2017

Great find @Quy !
It seems that it works, I've checked it on field title, name, label and text/values for fields color, list and checkboxes.
Regarding , ENT_COMPAT, 'UTF-8' part: PHP 5.4 and PHP 5.5 will use UTF-8 as the default encoding. In PHP 5.6 default_charset configuration option is used as the default value. Official docs on php.net still recommends specifying charset if you are using PHP 5.5 or earlier, so probably we should include it.

avatar joomla-cms-bot joomla-cms-bot - change - 25 Apr 2017
Category Administration com_fields
avatar esedic
esedic - comment - 25 Apr 2017

I've updated PR, reverted previous commit to helper file and updated fieldslistplugin.php.

avatar franz-wohlkoenig franz-wohlkoenig - change - 25 Apr 2017
Category Administration com_fields
avatar laoneo
laoneo - comment - 25 Apr 2017

List of changed file is empty, probably a missing commit.

avatar esedic
esedic - comment - 25 Apr 2017

Yep, I've made a commit to wrong branch. Done.

avatar Quy
Quy - comment - 25 Apr 2017

I appreciate the info/pr. I am not at my computer to test, however, the pr looks good.

avatar Quy Quy - test_item - 25 Apr 2017 - Tested successfully
avatar Quy
Quy - comment - 25 Apr 2017

I have tested this item successfully on 99e4a64

Created radio, checkboxes, and list custom fields. No errors on backend and frontend in article edit mode.


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

avatar franz-wohlkoenig franz-wohlkoenig - test_item - 25 Apr 2017 - Tested successfully
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 25 Apr 2017

I have tested this item successfully on 99e4a64


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

avatar franz-wohlkoenig franz-wohlkoenig - change - 25 Apr 2017
Status Pending Ready to Commit
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 25 Apr 2017

RTC after two successful tests.

avatar Quy
Quy - comment - 1 May 2017

Merge into 3.7.1?

avatar rdeutz rdeutz - change - 4 May 2017
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2017-05-04 21:44:23
Closed_By rdeutz
Labels Added: ?
avatar rdeutz rdeutz - close - 4 May 2017
avatar rdeutz rdeutz - merge - 4 May 2017

Add a Comment

Login with GitHub to post a comment