Project

General

Profile

Actions

Bug #84081

closed

Forms altered by hooks are not updated in form editor until editor is reloaded

Added by Jurian Janssen over 6 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Category:
Form Framework
Target version:
-
Start date:
2018-02-28
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
9
PHP Version:
7.2
Tags:
forms
Complexity:
Is Regression:
Sprint Focus:

Description

When a form definition is altered in one of the hooks that can be called via the Form engine (beforeFormSave, beforeFormCreate, beforeFormDuplicate) the altered information is correctly stored in the yaml file, but not in the form editor itself. I assume that the form editor does not reload the YAML or the changes made during the calling of a hook.

However, when a form is saved, altered by a hook and one then exists the form editor and re-opens it via the Forms module, the changes are there. Most likely because the editor now reads the entire yaml file.

Example: I create a form with a textfield called X. If I save, the the formstructure is sent to Mautic. However, to later edit field X I need the id mautic has given to field X. So I save the mautic id of field X in the yaml. This works fine. Except, when I press save, the yaml is updated, but the form editor does not reload the yaml sdo it doesn't know a mautic id has been given to field X. If I now press save again the form editor thinks there is no Mautic id, and creates again a new field in mautic (because the field is being posted without an id). Only when I exit the editor and then go back in (so reload the entire editor) the new yaml will be loaded.

In other words, whatever modifications you make with a hook, the form editor does not know until you close and re-open it again.

Actions #1

Updated by Jurian Janssen over 6 years ago

When a form definition is altered in one of the hooks that can be called via the Form engine (beforeFormSave, beforeFormCreate, beforeFormDuplicate) the altered information is correctly stored in the yaml file, but not in the form editor itself. I assume that the form editor does not reload the YAML or the changes made during the calling of a hook.

However, when a form is saved, altered by a hook and one then exits the form editor and re-opens it via the Forms module, the changes are there. Most likely because the editor now reads the entire yaml file.

Example with Mautic extension: I create a form with a textfield called X. If I save, the the formstructure is sent to Mautic. However, to later edit field X I need the id mautic has given to field X. So I save the mautic id of field X in the yaml. This works fine. Except, when I press save, the yaml is updated, but the form editor does not reload the yaml sdo it doesn't know a mautic id has been given to field X. If I now press save again the form editor thinks there is no Mautic id, and creates again a new field in mautic (because the field is being posted without an id). Only when I exit the editor and then go back in (so reload the entire editor) the new yaml will be loaded.

In other words, whatever modifications you make with a hook, the form editor does not know until you close and re-open it again.

Edited:
- Typo's

Actions #2

Updated by Ralf Zimmermann over 6 years ago

  • Status changed from New to Accepted
  • Assignee set to Ralf Zimmermann
Actions #3

Updated by Gerrit Code Review over 6 years ago

  • Status changed from Accepted 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/55958

Actions #4

Updated by Ralf Zimmermann over 6 years ago

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

Updated by Gerrit Code Review over 6 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56162

Actions #6

Updated by Ralf Zimmermann over 6 years ago

  • Status changed from Under Review to Resolved
Actions #7

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF