Project

General

Profile

Actions

Bug #91094

closed

Duplicating forms in form module is broken

Added by Christian Eßl over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Should have
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 #1

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

Actions #2

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

Actions #3

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

Actions #4

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

Actions #5

Updated by Andreas Fernandez over 4 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #6

Updated by Benni Mack over 4 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF