Skip to content

Commit

Permalink
fix(form): drop upload support for public forms
Browse files Browse the repository at this point in the history
  • Loading branch information
btry committed Mar 22, 2023
1 parent e24d2fc commit 43c3e63
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion inc/field/filefield.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ public function regex($value): bool {
}

public function isPublicFormCompatible(): bool {
return true;
return false;
}

public function getHtmlIcon() {
Expand Down
2 changes: 2 additions & 0 deletions inc/field/textareafield.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ public function getRenderedHtml($domain, $canEdit = true): string {
$fieldName = 'formcreator_field_' . $id;
$value = $this->value;
$html = '';
$form = PluginFormcreatorForm::getByItem($this->getQuestion());
$html .= Html::textarea([
'name' => $fieldName,
'editor_id' => "$fieldName$rand",
Expand All @@ -160,6 +161,7 @@ public function getRenderedHtml($domain, $canEdit = true): string {
'rows' => 5,
'display' => false,
'enable_richtext' => true,
'enable_images' => !$form->isPublicAccess(),
'enable_fileupload' => false,
'uploads' => $this->uploads,
]);
Expand Down

0 comments on commit 43c3e63

Please sign in to comment.