2. In InputfieldWrapper::_getDelayedChildren, in addition to dealing with child items that are themselves InputfieldWrappers (as is already done), where child items are instances of InputfieldRepeater then deal with the InputfieldWrappers contained in the repeater.
3. In InputfieldForm::selectorMatchesInputfield, get the inputfield in a way that handles inputfields that are contained within a repeater field in the form. I did this by modifying InputfieldWrapper::getChildByName by adding the following at line 1162...
...but I expect it would be better not to change this method and instead use some solution specific to InputfieldForm::selectorMatchesInputfield.
4. Show repeater items that have a "Missing required value" notice in an open state.
Currently InputfieldRepeater sets the openIDsfor empty required fields via InputfieldWrapper::getEmpty (incidentally I think this is the only place within the core that this method is used) but this method doesn't currently account for required-if conditions. So this method could be enhanced to use the same required-if evaluation that is used in InputfieldForm::processInputRequiredIf, or alternatively perhaps something could be added to InputfieldForm::processInputRequiredIf that sets repeater items to be opened when it evaluates that a required-if condition for a field within a repeater returns true.
Short description of the enhancement
It would be useful if we could use required-if conditions within repeaters.
I took a look at what might be needed to add support for this and came up with the following...
1. In
InputfieldRepeater.module
, remove the lines that setuseDepedencies
to false. https://github.com/processwire/processwire/blob/6ad523966655a03c60f3d76a9b38f7f3dfd2d33e/wire/modules/Fieldtype/FieldtypeRepeater/InputfieldRepeater.module#L338 https://github.com/processwire/processwire/blob/6ad523966655a03c60f3d76a9b38f7f3dfd2d33e/wire/modules/Fieldtype/FieldtypeRepeater/InputfieldRepeater.module#L3952. In
InputfieldWrapper::_getDelayedChildren
, in addition to dealing with child items that are themselves InputfieldWrappers (as is already done), where child items are instances of InputfieldRepeater then deal with the InputfieldWrappers contained in the repeater.Before line 1120:
3. In
InputfieldForm::selectorMatchesInputfield
, get the inputfield in a way that handles inputfields that are contained within a repeater field in the form. I did this by modifyingInputfieldWrapper::getChildByName
by adding the following at line 1162......but I expect it would be better not to change this method and instead use some solution specific to
InputfieldForm::selectorMatchesInputfield
.4. Show repeater items that have a "Missing required value" notice in an open state.
Currently InputfieldRepeater sets the
openIDs
for empty required fields via InputfieldWrapper::getEmpty (incidentally I think this is the only place within the core that this method is used) but this method doesn't currently account for required-if conditions. So this method could be enhanced to use the same required-if evaluation that is used inInputfieldForm::processInputRequiredIf
, or alternatively perhaps something could be added toInputfieldForm::processInputRequiredIf
that sets repeater items to be opened when it evaluates that a required-if condition for a field within a repeater returns true.