User tests: Successful: Unsuccessful:
Pull Request for Issue #25187
subform
child fields are validated. So a minimum validation happens like known from "normal" form fields if no filter
attribute is set for them.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.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
:
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
Status | New | ⇒ | Pending |
Category | ⇒ | Front End Plugins |
Labels |
Added:
?
|
Wasn't this as a result of JSST @SniperSister @zero-24
Yes. See edited first comment.
just click on ready for review
Thank you!
Title |
|
Title |
|
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.
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.
New commit contains:
text
and textarea
.filterfield
(hide if media
or number
)Code style OK??? I hate too long lines ;-)
@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.
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.
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.
Sorry, forgot to mention: in the Editor Plugin (fields) Filter is set to "Text", so tags should not be removed.
Sorry, forgot to mention: in the Editor Plugin (fields) Filter is set to "Text", so tags should not be removed.
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.
Can "Use settings from Plugin" be removed here?
I think it's not clear wich settings are meant: from editor or repeatable plugin.
Can "Use settings from Plugin" be removed here?
Give it a try! ;-) I removed global setting "Use settings from plugin".
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
the mentioned warning appears on editing an article
I have tested this item
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.
I have tested this item
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.
I have tested this item
I have tested text, textarea and editor with and without filters.
Works as expected.
Status | Pending | ⇒ | Ready to Commit |
Status "Ready To Commit".
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:
?
|
thx
Thank you, guys!
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.
That's really strange but if it works it's ok for me. thx
Wasn't this as a result of JSST @SniperSister @zero-24