Bug #91094
closedDuplicating forms in form module is broken
100%
Description
- Go to the form module in the backend
- Click the "Copy" button on any form element
- Fill out the wizard and click both "next" buttons
You should now see the following exception for a missing savePath:
(1/1) #1298012500 TYPO3\CMS\Extbase\Mvc\Controller\Exception\RequiredArgumentMissingException
Required argument "savePath" is not set for TYPO3\CMS\Form\Controller\FormManagerController->duplicate.
10 introduced the MultiStepWizard for the copying behaviour in the file typo3/sysext/form/Resources/Public/JavaScript/Backend/FormManager/ViewModel.js
There, in Wizard Step 2, a click event is registered for the next button, that saves the value of a select element in the savePath property:
nextButton.on('click', function(e) {
Icons.getIcon('spinner-circle', Icons.sizes.default, null, null).then(function(markup) {
MultiStepWizard.set('confirmationDuplicateFormName', that.data('formName'));
MultiStepWizard.set('savePath', $(getDomElementIdentifier('duplicateFormSavePath') + ' option:selected', modal).val());
if (folders.length > 1) {
MultiStepWizard.set('confirmationDuplicateFormSavePath', $(getDomElementIdentifier('duplicateFormSavePath') + ' option:selected', modal).text());
} else {
MultiStepWizard.set('confirmationDuplicateFormSavePath', folders[0]['label']);
}
slide.html($('<div />', {class: 'text-center'}).append(markup));
});
});
If you now click "next" and are directed to Wizard Step 3, this click event remains on the new "next" button. So clicking the "next" button of step 3 will now trigger the click event again and this time savePath will be null, because the "duplicateFormSavePath" select is not present in step 3.
Updated by Gerrit Code Review over 4 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64214
Updated by Gerrit Code Review over 4 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64214
Updated by Gerrit Code Review over 4 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64214
Updated by Gerrit Code Review over 4 years ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64214
Updated by Andreas Fernandez over 4 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 4b681fd3228b768da138ddc002dd5d4700febea2.