? ? Success

User tests: Successful: Unsuccessful:

avatar ReLater
ReLater
12 Jun 2019

Pull Request for Issue #25187

Summary of Changes

  • Since Joomla 3.9.7 subform child fields are validated. So a minimum validation happens like known from "normal" form fields if no filter attribute is set for them.
  • Because the com_fileds repeatable field uses a subform HTML tags are removed e.g. from editor or textarea contents during validation. This PR adds a filter field to any subfield row of repeatable fields.

Testing Instructions

  • Create a new com_fields field for Articles of type repeatable .

  • Add a subfield of type Editor.

  • Edit an article and enter some paragraphs in that editor.

  • Save the article => paragraphs removed.

  • Apply patch.

  • Open above field.

  • You'll see a new filter field for any row but for rows with type Media or Number:

12-06-_2019_15-48-04

  • Set Filter "Text" or "Safe Html."

  • Save field.

  • Open and edit article again or use a new one and enter some paragraphs => Save article => paragraphs NOT removed.

  • Test if filters are applied and work as expected for any field types.

  • The filter options change depending on your selection in Type

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
3.00

avatar ReLater ReLater - open - 12 Jun 2019
avatar ReLater ReLater - change - 12 Jun 2019
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 12 Jun 2019
Category Front End Plugins
avatar ReLater ReLater - change - 12 Jun 2019
Labels Added: ?
avatar brianteeman
brianteeman - comment - 12 Jun 2019

Wasn't this as a result of JSST @SniperSister @zero-24

avatar ReLater ReLater - change - 12 Jun 2019
The description was changed
avatar ReLater ReLater - edited - 12 Jun 2019
avatar ReLater ReLater - change - 12 Jun 2019
The description was changed
avatar ReLater ReLater - edited - 12 Jun 2019
avatar ReLater ReLater - change - 12 Jun 2019
The description was changed
avatar ReLater ReLater - edited - 12 Jun 2019
avatar ReLater
ReLater - comment - 12 Jun 2019

Wasn't this as a result of JSST @SniperSister @zero-24

Yes. See edited first comment.

avatar ReLater ReLater - change - 12 Jun 2019
The description was changed
avatar ReLater ReLater - edited - 12 Jun 2019
avatar ReLater ReLater - change - 12 Jun 2019
The description was changed
avatar ReLater ReLater - edited - 12 Jun 2019
avatar alikon
alikon - comment - 12 Jun 2019

How can I convert a draft pr to a regular one on GitHub????

just click on ready for review

image

avatar ReLater
ReLater - comment - 12 Jun 2019

just click on ready for review

Thank you!

avatar ReLater ReLater - change - 12 Jun 2019
The description was changed
avatar ReLater ReLater - edited - 12 Jun 2019
avatar ReLater ReLater - change - 12 Jun 2019
Title
Repeatable custom field: Editor and Textarea fields always filter HTML since J 3.9.8
[com_fields] Field type Repeatable. Editor and Textarea subfields fields remove HTML since J 3.9.7
avatar ReLater ReLater - edited - 12 Jun 2019
avatar ReLater ReLater - change - 12 Jun 2019
Title
[com_fields] Field type Repeatable. Editor and Textarea subfields fields remove HTML since J 3.9.7
[com_fields] Field type Repeatable. Editor and Textarea subfields remove HTML since J 3.9.7
avatar ReLater ReLater - edited - 12 Jun 2019
avatar ReLater ReLater - change - 12 Jun 2019
The description was changed
avatar ReLater ReLater - edited - 12 Jun 2019
avatar ReLater ReLater - change - 12 Jun 2019
The description was changed
avatar ReLater ReLater - edited - 12 Jun 2019
avatar lunalars
lunalars - comment - 12 Jun 2019

filter not making sense: maybe the filter should only be visible if editor or textarea is selected.
added your code manually and also added showon="fieldtype:editor[OR]fieldtype:textarea to fieldfilter and did some quick tests. seems to work for all selected fieldtypes.


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

avatar lunalars
lunalars - comment - 12 Jun 2019

filter not making sense: maybe the filter should only be visible if editor or textarea is selected.
added your code manually and also added showon="fieldtype:editor[OR]fieldtype:textarea to fieldfilter and did some quick tests. seems to work for all selected fieldtypes.


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

avatar ReLater
ReLater - comment - 12 Jun 2019

New commit contains:

  • Added more filter options. Taken over from single field types text and textarea.
  • Added showon to filterfield (hide if media or number)
  • Added showon to options.

Code style OK??? I hate too long lines ;-)

avatar ReLater ReLater - change - 12 Jun 2019
The description was changed
avatar ReLater ReLater - edited - 12 Jun 2019
avatar ReLater ReLater - change - 13 Jun 2019
The description was changed
avatar ReLater ReLater - edited - 13 Jun 2019
avatar ReLater
ReLater - comment - 13 Jun 2019

@BPBlueprint @lunalars
Could you please test this pr and mark your tests unsuccessful or successful on https://issues.joomla.org/tracker/joomla-cms/25189 . It's easy to apply and remove the patch with extension "Joomla! Patch Tester".

Normally I lose interest after 1 or 2 months in my prs and fixing branch conflicts ;-) if I don't use features myself.

avatar lunalars
lunalars - comment - 13 Jun 2019

If I set fieldtype to "Editor" and filter to "Use settings from Plugin" the HTML tags are still removed - should it be like this?
other settings work just fine.


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

avatar lunalars
lunalars - comment - 13 Jun 2019

If I set fieldtype to "Editor" and filter to "Use settings from Plugin" the HTML tags are still removed - should it be like this?
other settings work just fine.


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

avatar lunalars
lunalars - comment - 13 Jun 2019

Sorry, forgot to mention: in the Editor Plugin (fields) Filter is set to "Text", so tags should not be removed.


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

avatar lunalars
lunalars - comment - 13 Jun 2019

Sorry, forgot to mention: in the Editor Plugin (fields) Filter is set to "Text", so tags should not be removed.


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

avatar ReLater ReLater - change - 13 Jun 2019
The description was changed
avatar ReLater ReLater - edited - 13 Jun 2019
avatar ReLater
ReLater - comment - 13 Jun 2019

Sorry, forgot to mention: in the Editor Plugin (fields) Filter is set to "Text", so tags should not be removed.

Yes, you're right.
Set in plugin "Fields - Editor" filter to "Text".
In custom repeatable field select Editor and set filter to "Use settings from plugin".
Setting is not respected.
(Added as "Known bug" to intro comment.)

Sorry, then I have to give up here without assistance of others.

avatar ReLater ReLater - change - 13 Jun 2019
The description was changed
avatar ReLater ReLater - edited - 13 Jun 2019
avatar lunalars
lunalars - comment - 13 Jun 2019

Can "Use settings from Plugin" be removed here?
I think it's not clear wich settings are meant: from editor or repeatable plugin.

avatar ReLater
ReLater - comment - 13 Jun 2019

Can "Use settings from Plugin" be removed here?

Give it a try! ;-) I removed global setting "Use settings from plugin".

avatar lunalars
lunalars - comment - 13 Jun 2019

very nice :-)
One more: I get SimpleXMLElement::addAttribute(): Attribute already exists in plugins/fields/repeatable/repeatable.php on line 72
child attribute is already set on line 66

avatar lunalars
lunalars - comment - 13 Jun 2019

the mentioned warning appears on editing an article

avatar lunalars
lunalars - comment - 13 Jun 2019

I have tested this item successfully on 1824077

With the latest code selected filters work as expected. Tested all filters for text, textarea and editor.

The warning was gone after applying the latest patch correctly.


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

avatar lunalars
lunalars - comment - 13 Jun 2019

I have tested this item successfully on 1824077

With the latest code selected filters work as expected. Tested all filters for text, textarea and editor.

The warning was gone after applying the latest patch correctly.


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

avatar lunalars lunalars - test_item - 13 Jun 2019 - Tested successfully
avatar ReLater ReLater - change - 13 Jun 2019
The description was changed
avatar ReLater ReLater - edited - 13 Jun 2019
avatar BPBlueprint
BPBlueprint - comment - 14 Jun 2019

I have tested this item successfully.

I have tested text, textarea and editor with and without filters.
Works as expected.

avatar franz-wohlkoenig franz-wohlkoenig - change - 14 Jun 2019
Status Pending Ready to Commit
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 14 Jun 2019

Status "Ready To Commit".

avatar HLeithner HLeithner - close - 14 Jun 2019
avatar HLeithner HLeithner - merge - 14 Jun 2019
avatar HLeithner HLeithner - change - 14 Jun 2019
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2019-06-14 10:12:48
Closed_By HLeithner
Labels Added: ?
avatar HLeithner
HLeithner - comment - 14 Jun 2019

thx

avatar ReLater
ReLater - comment - 14 Jun 2019

Thank you, guys!

avatar ReLater
ReLater - comment - 19 Jun 2019

And isset($formField->fieldfilter) will in this case always be true.

No. If you select type Media then fieldfilter is not set/is undefined and that was the reason for this line because you get a warning.

JNO=0 comes from the params that you can find in the params.xml of the plugins for single fields. E.g.
https://github.com/joomla/joomla-cms/blob/staging/plugins/fields/textarea/params/textarea.xml#L40

For me the question is: What effect should filter="0" have? Really no filtering (="unset"), fall back to "string" ... ? I don't know.

value="" was removed because it doesn't work. You can test that by setting a filter in the com_fields editor plugin. It's ignored in the repeatable field if you set "COM_FIELDS_FIELD_USE_GLOBAL".
https://github.com/joomla/joomla-cms/blob/staging/plugins/fields/textarea/params/textarea.xml#L39

TBH I never use com_fields and just provided this pr because we have submitted the security issue then and forgot to test com_fields repeatable and wanted to help concerned users quickly. @bembelimen can provide and describe a corrective pr if he thinks that something doesn't work here as expected.

avatar HLeithner
HLeithner - comment - 19 Jun 2019

That's really strange but if it works it's ok for me. thx

Add a Comment

Login with GitHub to post a comment