User tests: Successful: Unsuccessful:
Pull Request for Issue # #27736.
I hid the require parameter in the Custom Field subfield
.
Create a custom field of the type subfield
Apply this patch and see, that the parameter require is not shown anymore.
If the option required
is offered, the value of the field should have an impact.
In the case of a subfield
, technically there is always a value. Therefore, the assignment of this option does not matter.
The field is shown unnecessarily here.
Yes
https://docs.joomla.org/Custom_fields_type:_Subfields
https://docs.joomla.org/J3.x:Adding_custom_fields (Here the subfield is missing at all)
Category | ⇒ | Front End Plugins |
Status | New | ⇒ | Pending |
Title |
|
Labels |
Added:
?
|
@richard67 As far as I understand it is no problem because the field value doesn't have any impact on function
Yes, if I have understood everything correctly, the subfield field is saved, regardless of whether require is 1 or 0.
You can only "make" the field as a mandatory field by specifying one of the field inside the subfield
as a mandatory field.
I have tested this item
Works as promised: When selecting "subfields" as field type, the "required" switcher is hidden, and when selecting another field type the switcher it is shown.
When selecting another field type than "Subflields (subfields)" and setting "required" to "yes" and then changing field type to "Subflields (subfields)" while still editing the field (i.e. not having saved yet), the "required" field is hidden but the value is 1 and not 0. Is that a problem?
hm, it sounds like it may have a problem,
did you tried test it #27736 after that?
I cannot test currently, I try later this week
@Fedik I've just tested. First created a text field with required=no, then created a field where I first had set type type to text field and then had set required=yes and then had changed type to subfields and then saved. then created article and was allowed to save it with emtpy text field. then edited text field and set required to yes, then edited article and verified that i was not allowed to save it because required text field was empty. Finally filled in the required text field and was able to save. So to me it looks all ok.
@richard67 thanks for checking, btw, it was subform with multiple=yes or multiple=no?
I don't understand where you see the problem.
It just my assumption, because cannot check on my own currently
the idea if you change the field type, then "required=1" still stay, but not editable now,
so I have assume it can lead to this issue #27736
@Fedik No, was subform with one text field only. Tested as described in my comment above.
Ah. Have to test later.
@richard67 I just tested, you were right after changing the field type the value required=1 stays,
however while validation it forced to required=0, and so the issue #27736 somehow fixed
strange, but okay
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC
RTC
@richard67 I just tested, you were right after changing the field type the value required=1 stays,
however while validation it forced to required=0, and so the issue #27736 somehow fixedstrange, but okay
@Fedik Ive seen when I was working on global configuration and installation form for the database connection encryption that this seems to be the way we do. we don't reset fields to default values when hiding them because together with showon conditions and possible default values this can be very complicated. Instead of this we fix that in server side validation in PHP after form validation.
Status | Ready to Commit | ⇒ | Needs Review |
this dosen't look right to me, removing rtc, I have too look into this again
As I do not have an idea for a change I close this.
Status | Needs Review | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-03-14 09:42:21 |
Closed_By | ⇒ | astridx |
@astridx When selecting another field type than "Subflields (subfields)" and setting "required" to "yes" and then changing field type to "Subflields (subfields)" while still editing the field (i.e. not having saved yet), the "required" field is hidden but the value is 1 and not 0. Is that a problem? As far as I understand it is no problem because the field value doesn't have any impact on function for that field type, but I ask just to be sure my understanding is right. @Fedik What do you think?