? Pending

User tests: Successful: Unsuccessful:

avatar chmst
chmst
18 Feb 2020

Summary of Changes

A repeatable field without content causes a warning in an article.

Testing Instructions

Make a custom field of type repeatable and save it without adding a field.
Then open an article.

Expected result

The article is displayed

Actual result

Warning: Invalid argument supplied for foreach() in plugins\fields\repeatable\repeatable.php on line 89

Documentation Changes Required

idk

avatar chmst chmst - open - 18 Feb 2020
avatar chmst chmst - change - 18 Feb 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 18 Feb 2020
Category Front End Plugins
avatar chmst chmst - change - 18 Feb 2020
Title
Fix Notice in repeatable fields
[4.0] Fix Notice in repeatable field
avatar chmst chmst - edited - 18 Feb 2020
avatar chmst chmst - change - 18 Feb 2020
The description was changed
avatar chmst chmst - edited - 18 Feb 2020
avatar chmst chmst - change - 18 Feb 2020
Title
[4.0] Fix Notice in repeatable field
[4.0] Fix Warning in repeatable field
avatar chmst chmst - edited - 18 Feb 2020
avatar wilsonge
wilsonge - comment - 18 Feb 2020

This should be optional instead. On line 89 we should allow the field to be empty unless the required attribute is set to true

avatar chmst chmst - change - 19 Feb 2020
Labels Added: ?
avatar chmst chmst - change - 19 Feb 2020
The description was changed
avatar chmst chmst - edited - 19 Feb 2020
avatar wilsonge
wilsonge - comment - 20 Feb 2020

Looks better. Just to check with this change do we get an error if the field is set as required in XML?

avatar chmst
chmst - comment - 20 Feb 2020

It makes no difference. With this PR there is no warning, that's all.

But it is possible to save a repeatable field (the container) with required=false
and no field in it.
This results in fields which looks like this:
empty-repeatable

So I wanted to make sure that at least one input field must be added to a repeatable.
But could be another issue / PR.

avatar ChristineWk
ChristineWk - comment - 23 Feb 2020

I have tested this item successfully on b563cbc

In generell, don't know about repeatable fields yet :-)

But confirm Actual Result. After Patch: Warning has gone.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/27979.
avatar ChristineWk ChristineWk - test_item - 23 Feb 2020 - Tested successfully
avatar Quy
Quy - comment - 25 Feb 2020

I am not able to reproduce the warning before the PR.

avatar chmst
chmst - comment - 25 Feb 2020

Could you save a repeatable field without a field?

avatar Quy
Quy - comment - 25 Feb 2020

Yes

avatar ChristineWk
ChristineWk - comment - 25 Feb 2020

Will try to load an image.
warning

avatar Quy
Quy - comment - 25 Feb 2020

I tested with the latest development branch.

avatar chmst
chmst - comment - 25 Feb 2020

Meanwhile this PR a10d553 this avoids empty $formFields.

I close this one.
Thank you for testing.

avatar chmst chmst - change - 25 Feb 2020
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2020-02-25 19:25:20
Closed_By chmst
avatar chmst chmst - close - 25 Feb 2020

Add a Comment

Login with GitHub to post a comment