Skip to content

Commit

Permalink
fix(ipfield, hiddenfield): do not generate HTML input if edition disa…
Browse files Browse the repository at this point in the history
…bled

Signed-off-by: Thierry Bugier <[email protected]>
  • Loading branch information
btry committed Sep 13, 2021
1 parent 5386f65 commit 0776ef2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions inc/field/hiddenfield.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ public function getDesignSpecializationField(): array {
}

public function show($domain, $canEdit = true) {
if (!$canEdit) {
return '';
}

$id = $this->question->getID();
$rand = mt_rand();
$fieldName = 'formcreator_field_' . $id;
Expand Down
4 changes: 4 additions & 0 deletions inc/field/ipfield.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ public function prepareQuestionInputForSave($input) {
}

public function show($domain, $canEdit = true) {
if (!$canEdit) {
return '';
}

$id = $this->question->getID();
$rand = mt_rand();
$fieldName = 'formcreator_field_' . $id;
Expand Down

0 comments on commit 0776ef2

Please sign in to comment.