Skip to content

Add export/import functionality for forms#3380

Open
timedin-de wants to merge 2 commits into
nextcloud:mainfrom
timedin-de:feat/download-option
Open

Add export/import functionality for forms#3380
timedin-de wants to merge 2 commits into
nextcloud:mainfrom
timedin-de:feat/download-option

Conversation

@timedin-de

@timedin-de timedin-de commented Jun 4, 2026

Copy link
Copy Markdown

building export and import via json
Download Button:

  • fetches Forms Data (questions and settings, removes ids and hashes) => Downloads as json blob
  • adds version of the app => on import, warn if downgrade
  • modal to ask if answers should get exported as well? (!handle file uploads, not exported)

#1425

@timedin-de timedin-de changed the title Add export/import functionality for forms Add export/import functionality for forms #1425 Jun 4, 2026
@timedin-de
timedin-de force-pushed the feat/download-option branch 4 times, most recently from 88628b8 to 87bfc7c Compare June 5, 2026 17:09
@codecov

codecov Bot commented Jun 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 61.90476% with 16 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
lib/Controller/ApiController.php 61.90% 16 Missing ⚠️

📢 Thoughts on this report? Let us know!

@Chartman123

Copy link
Copy Markdown
Collaborator

@timedin-de Please don't merge the main branch into your branch, always rebase your's on main. Also please sign-off your commits.

@timedin-de
timedin-de force-pushed the feat/download-option branch from 5a575cf to c5fb19b Compare June 5, 2026 21:10
@timedin-de

timedin-de commented Jun 5, 2026

Copy link
Copy Markdown
Author

@Chartman123 i dont think i did merge the main branch into mine, did sth slip through? Yes, will do, sorry for forgetting it everytime ^^

@timedin-de
timedin-de force-pushed the feat/download-option branch 2 times, most recently from 9c27a97 to 958c585 Compare June 5, 2026 21:24
@Chartman123

Copy link
Copy Markdown
Collaborator

Now the history looks clean, don't now what it was then...

@timedin-de
timedin-de force-pushed the feat/download-option branch 2 times, most recently from b24065c to 992e49d Compare June 6, 2026 18:11
@timedin-de
timedin-de marked this pull request as ready for review June 6, 2026 18:12
@timedin-de
timedin-de force-pushed the feat/download-option branch from 992e49d to 87a5043 Compare June 6, 2026 19:39

@Chartman123 Chartman123 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've had a quick look at the PR and added a few comments :)

Comment thread src/Forms.vue Outdated
Comment thread src/Forms.vue
Comment thread lib/Controller/ApiController.php
Comment thread lib/Controller/ApiController.php
Comment thread lib/Controller/ApiController.php
@timedin-de

timedin-de commented Jun 13, 2026

Copy link
Copy Markdown
Author

@Chartman123 i added the fixup commits for your comments, i'll rebase them if you accept them

One other thing I would improve is validation/sanitasation of import/export.

I'd make whitelist for allowed properties and remove others (or fail the request?) and copy the validations for questions: areExtraSettingsValid and array_search($type, Constants::ANSWER_TYPES)
and options:

@github-actions

Copy link
Copy Markdown
Contributor

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

@Chartman123

Copy link
Copy Markdown
Collaborator

@timedin-de are you still working on this?

@timedin-de

Copy link
Copy Markdown
Author

@timedin-de are you still working on this?

yes, im currently less active. Do you have any additions missing in this? And a decision for sanitazation?

@Chartman123

Copy link
Copy Markdown
Collaborator

And a decision for sanitazation?

I vote for the whitelist and throw an error if other properties are part of the request.

Do you have any additions missing in this?

No, don't think so :)

@timedin-de
timedin-de force-pushed the feat/download-option branch 3 times, most recently from a6159d1 to 1958037 Compare July 22, 2026 13:17
@Chartman123 Chartman123 changed the title Add export/import functionality for forms #1425 Add export/import functionality for forms Jul 22, 2026
@Chartman123 Chartman123 linked an issue Jul 22, 2026 that may be closed by this pull request
@timedin-de
timedin-de force-pushed the feat/download-option branch 2 times, most recently from 9727e29 to 6a8b845 Compare July 22, 2026 13:24
@Chartman123

Copy link
Copy Markdown
Collaborator

@timedin-de Did you merge main again? Please always use rebase... And can you please remove the issue id from the commit message? It creates a new log record on every push in the issue.

@timedin-de
timedin-de force-pushed the feat/download-option branch from 6a8b845 to 06a1c8a Compare July 22, 2026 13:29
@timedin-de

timedin-de commented Jul 22, 2026

Copy link
Copy Markdown
Author

@timedin-de Did you merge main again? Please always use rebase... And can you please remove the issue id from the commit message? It creates a new log record on every push in the issue.

I'm sorry, i dont know what, but something got messed up while rebasing (promise, i didnt merge 😬 ) Now it should be clean.

Edit: it seems it messed up while doing the interactive rebase, I'll need to recheck the git docs on that.

@timedin-de
timedin-de force-pushed the feat/download-option branch from 06a1c8a to f17f825 Compare July 22, 2026 13:29
@Chartman123

Copy link
Copy Markdown
Collaborator

I think you need to make sure that your forked main is up-to-date before doing the rebase :)

Signed-off-by: TimedIn <git@timedin.net>
Signed-off-by: TimedIn <git@timedin.net>
@timedin-de
timedin-de force-pushed the feat/download-option branch from f17f825 to a3e728d Compare July 22, 2026 16:03
@timedin-de

Copy link
Copy Markdown
Author

I think you need to make sure that your forked main is up-to-date before doing the rebase :)

thanks, yeah that and i ran git rebase -i HEAD~10 but should've git rebase -i main ^^

Now it should be clean

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add export/import functionality for forms (transferability)

2 participants