Skip to content

Commit

Permalink
RoleForm: Force a suffix for all element names
Browse files Browse the repository at this point in the history
fixes #4973
  • Loading branch information
nilmerg committed Jun 22, 2023
1 parent 5000d31 commit c40cfb4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion application/forms/Security/RoleForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ protected function createFilter()
return Filter::where('name', $this->getIdentifier());
}

public function filterName($value, $allowBrackets = false)
{
return parent::filterName($value, $allowBrackets) . '_element';
}

public function createInsertElements(array $formData = array())
{
$this->addElement(
Expand Down Expand Up @@ -156,7 +161,7 @@ public function createInsertElements(array $formData = array())
if (! isset($spec['isFullPerm'])
&& substr($name, 0, strlen(self::DENY_PREFIX)) !== self::DENY_PREFIX
) {
$denyCheckbox = $this->createElement('checkbox', self::DENY_PREFIX . $name, [
$denyCheckbox = $this->createElement('checkbox', $this->filterName(self::DENY_PREFIX . $name), [
'decorators' => ['ViewHelper']
]);
$this->addElement($denyCheckbox);
Expand Down

0 comments on commit c40cfb4

Please sign in to comment.