mirror of
https://github.com/processwire/processwire.git
synced 2025-08-10 08:44:46 +02:00
Fix issue #128
This commit is contained in:
@@ -431,8 +431,18 @@ class InputfieldRepeater extends Inputfield implements InputfieldItemList {
|
|||||||
if($itemID) break;
|
if($itemID) break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($itemID) {
|
||||||
|
// only rendering a single item, ajax mode
|
||||||
|
foreach($form->getAll() as $inputfield) {
|
||||||
|
$idAttr = $inputfield->attr('id');
|
||||||
|
$inputfield->renderReady($form, $this->renderValueMode);
|
||||||
|
$jsValue = $this->wire('config')->js($idAttr);
|
||||||
|
if(!empty($jsValue)) {
|
||||||
|
$inputfield->appendMarkup .= "<script>ProcessWire.config['$idAttr'] = " . json_encode($jsValue) . ';</script>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
// create a new/blank item to be used as a template for any new items added
|
// create a new/blank item to be used as a template for any new items added
|
||||||
if(!$itemID) {
|
|
||||||
/** @var InputfieldWrapper $wrap */
|
/** @var InputfieldWrapper $wrap */
|
||||||
$wrap = $this->wire('modules')->get('InputfieldFieldset');
|
$wrap = $this->wire('modules')->get('InputfieldFieldset');
|
||||||
$wrap->label = $this->renderRepeaterLabel($label, ++$cnt, new NullPage());
|
$wrap->label = $this->renderRepeaterLabel($label, ++$cnt, new NullPage());
|
||||||
|
Reference in New Issue
Block a user