1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-27 00:25:05 +02:00

Fix issue processwire/processwire-issues#197 correcting an issue with repeater item label contained string "{images.count}"

This commit is contained in:
Ryan Cramer
2017-03-09 15:12:26 -05:00
parent 97f33e02ed
commit 020c1beca5

View File

@@ -298,6 +298,7 @@ class InputfieldRepeater extends Inputfield implements InputfieldItemList {
$cnt = 0;
$numVisible = 0;
$numOpen = 0;
$isPost = $this->wire('input')->requestMethod('POST');
// create field for each repeater iteration
foreach($value as $key => $page) {
@@ -357,10 +358,14 @@ class InputfieldRepeater extends Inputfield implements InputfieldItemList {
$wrap = $this->wire('modules')->get('InputfieldFieldset');
$wrap->addClass('InputfieldRepeaterItem InputfieldNoFocus');
$wrap->entityEncodeLabel = false;
$wrap->label =
"<span class='InputfieldRepeaterItemLabel'>" .
$this->entityEncode($this->renderRepeaterLabel($label, ++$cnt, $page)) .
"</span>";
if(!$isPost) {
$wrap->label =
"<span class='InputfieldRepeaterItemLabel'>" .
$this->entityEncode($this->renderRepeaterLabel($label, ++$cnt, $page)) .
"</span>";
} else {
$wrap->label = "$label " . (++$cnt);
}
$wrap->name = "repeater_item_{$page->id}";
$wrap->wrapAttr('data-page', $page->id);
$wrap->wrapAttr('data-type', $this->getRepeaterItemType($page));