Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add toolbar action for creating copy of current form to edit view #316

Merged
merged 10 commits into from
Apr 1, 2022

Conversation

niklasnatter
Copy link
Contributor

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Fixed tickets fixes #151
Related issues/PRs depends on sulu/sulu#6475
License MIT

What's in this PR?

This pull requests adds a toolbar action for creating a copy of the current form to the form edit view. It depends on the toolbar action implemented in sulu/sulu#6475.

Why?

See #151

$data['title'] = $data['title'] . ' (2)';

/** @var array{ options: \stdClass|mixed[] } $field */
foreach ($data['fields'] as &$field) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is needed because the getApiEntity method returns an empty \stdClass here:

$fieldData['options'] = new \stdClass(); // convert options to "{}"

@alexander-schranz alexander-schranz enabled auto-merge (squash) April 1, 2022 13:31
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Copy function of existing forms
2 participants