Actions
Bug #91094
closedDuplicating forms in form module is broken
Status:
Closed
Priority:
Should have
Assignee:
Category:
Backend JavaScript
Target version:
Start date:
2020-04-17
Due date:
% Done:
100%
Estimated time:
TYPO3 Version:
10
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:
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.
Actions