From 087e57bc19ca1d4da8ab2b577d18e3e53cbc1122 Mon Sep 17 00:00:00 2001 From: Jan Kristinus Date: Thu, 20 Jun 2024 12:21:40 +0200 Subject: [PATCH] CS --- plugins/manager/lib/yform/value/be_media.php | 7 ++----- .../manager/ytemplates/bootstrap/value.be_media.tpl.php | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/plugins/manager/lib/yform/value/be_media.php b/plugins/manager/lib/yform/value/be_media.php index 2b5f8f117..ef34e5d4b 100644 --- a/plugins/manager/lib/yform/value/be_media.php +++ b/plugins/manager/lib/yform/value/be_media.php @@ -25,9 +25,6 @@ public function enterObject() $this->setValue(implode(',', $medias)); } - static $counter = 0; - ++$counter; - $types = $this->getElement('types') ?? ''; // to be in line with upload field if ('*' == $types) { @@ -38,10 +35,10 @@ public function enterObject() if (!$this->isEditable()) { $this->params['form_output'][$this->getId()] = $this->parse( ['value.view.tpl.php', 'value.be_media-view.tpl.php'], - ['counter' => $counter, 'value' => explode(',', $this->getValue()), 'types' => $types], + ['value' => explode(',', $this->getValue()), 'types' => $types], ); } else { - $this->params['form_output'][$this->getId()] = $this->parse('value.be_media.tpl.php', compact('counter', 'types')); + $this->params['form_output'][$this->getId()] = $this->parse('value.be_media.tpl.php', compact('types')); } } diff --git a/plugins/manager/ytemplates/bootstrap/value.be_media.tpl.php b/plugins/manager/ytemplates/bootstrap/value.be_media.tpl.php index 86182e352..d559b85a0 100644 --- a/plugins/manager/ytemplates/bootstrap/value.be_media.tpl.php +++ b/plugins/manager/ytemplates/bootstrap/value.be_media.tpl.php @@ -5,7 +5,7 @@ * @psalm-scope-this rex_yform_value_be_media */ -$counter ??= 1; +$counter ??= 1000; $buttonId = $counter; $name = $this->getFieldName();