Skip to content

Commit f810095

Browse files
authored
Merge pull request #3189 from nextcloud/backport/3187/stable5.2
[stable5.2] fix: clone shared form and set default values
2 parents 4a9c0d7 + fc25dab commit f810095

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

lib/Controller/ApiController.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,19 @@ public function newForm(?int $fromId = null): DataResponse {
192192
unset($formData['fileFormat']);
193193
unset($formData['lockedBy']);
194194
unset($formData['lockedUntil']);
195+
$formData['ownerId'] = $this->currentUser->getUID();
195196
$formData['hash'] = $this->formsService->generateFormHash();
196197
// TRANSLATORS Appendix to the form Title of a duplicated/copied form.
197198
$formData['title'] .= ' - ' . $this->l10n->t('Copy');
199+
$formData['access'] = [
200+
'permitAllUsers' => false,
201+
'showToAllUsers' => false,
202+
];
203+
$formData['submitMultiple'] = false;
204+
$formData['allowEditSubmissions'] = false;
205+
$formData['showExpiration'] = false;
206+
$formData['expires'] = 0;
207+
$formData['isAnonymous'] = false;
198208

199209
$form = Form::fromParams($formData);
200210
$this->formMapper->insert($form);

src/Forms.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
:form="form"
5252
read-only
5353
@open-sharing="openSharing"
54+
@clone="onCloneForm"
5455
@mobile-close-navigation="mobileCloseNavigation" />
5556
</ul>
5657
</template>

0 commit comments

Comments
 (0)