Project

General

Profile

Actions

Bug #76863

closed

Story #69617: FormEngine bugs

MM Relation with selectMultipleSideBySide Field - Add wizard resets the MM Relation

Added by Volker Kemeter almost 8 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Must have
Assignee:
Category:
FormEngine aka TCEforms
Start date:
2016-06-29
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
8
PHP Version:
7.0
Tags:
Complexity:
Is Regression:
No
Sprint Focus:
Stabilization Sprint

Description

when you create an extension with one table and a mm relation to another table (no special features needed) and the tca for the relation is set to "selectMultipleSideBySide" you can add the created items from right to left.

but when you use the add wizard to create a new item, the saved relations are resetted to "two" items where the first one is exactly the count of the "old" relation (for example 4 relations where set) and the new item prepended.

i added an example extension (build with extension builder) to demonstrate that behavior.

  1. add test1 entry
  2. add relation in that test1 entry via add icon
  3. repeat
  4. add relation items in listview
  5. edit test1 entry
  6. add all the relation items and save
  7. use add button to create a new relation
  8. relations are resetted

Files


Related issues 5 (1 open4 closed)

Related to TYPO3 Core - Bug #79712: triple entries in mm table when copying pageNew2017-02-09

Actions
Related to TYPO3 Core - Bug #81855: Add new record wizard fails on Save&Close with "select" field and MM settedClosed2017-07-13

Actions
Related to TYPO3 Core - Bug #82016: Wizards add still not working with MMClosed2017-08-01

Actions
Related to TYPO3 Core - Bug #82461: Backend/TCA: fieldControl->addRecord removes old relations after creating an new entry in the foreign table for the new relation Closed2017-09-12

Actions
Has duplicate TYPO3 Core - Bug #81824: Wizards add not working with MMClosed2017-07-10

Actions
Actions #1

Updated by Wouter Wolters almost 8 years ago

  • Assignee deleted (Mathias Schreiber)
  • Priority changed from -- undefined -- to Could have
Actions #2

Updated by Christian Kuhn over 7 years ago

  • Parent task set to #69617
Actions #3

Updated by Volker Kemeter over 7 years ago

also reproduced with version 8.4.0-dev

Actions #4

Updated by Markus Kobligk over 7 years ago

Confirmed on 7.6.9

Actions #5

Updated by Kevin Ditscheid over 7 years ago

Could someone test my solution for this? I created a GIT repository with an extension, that changes the FormDataCompiler to provide the MM relations instead of just fetching the record from the database and prepend/append the new record uid to the value of the database row.

https://github.com/bara0801/add_wizard

The magic happens in the AddController, which is just an override for the TYPO3\CMS\Backend\Controller\Wizard\AddController classes main method. There I replaced the OnTheFly instance with the TcaDatabaseRecord instance, to have the same data compiling as in the TYPO3\CMS\Backend\Controller\EditDocumentController->makeEditForm method.

As my approach is just a little hotfix for a project of mine, this is not tested on breaking other functionalities, yet, but I hope it could help someone integrating a fix into the core.

Actions #6

Updated by Gernot Ploiner over 7 years ago

Hi Kevin, thank you for your "Hotfix-Extension". It works fine in our case with TYPO3 7.6.14.

Actions #7

Updated by Michael Christian over 7 years ago

  • Priority changed from Could have to Must have
  • % Done changed from 0 to 30

Hi, the "add_wizard bugfix extension" is working fine in my case, too. I tested it with a MM Relation to tx_news and with V7.6.9.
Thanks a lot to Kevin Ditscheid for the Bugfix and Volker Kemeter for the Bugreport and Test-Extension!

Could someone please fix the Core.

Actions #8

Updated by Josef Glatz about 7 years ago

  • TYPO3 Version changed from 7 to 8
Actions #9

Updated by Josef Glatz about 7 years ago

  • Target version set to 8 LTS
Actions #10

Updated by Thomas Hohn about 7 years ago

  • Assignee set to Thomas Hohn
  • PHP Version set to 7.0
  • Sprint Focus set to Stabilization Sprint
Actions #11

Updated by Gerrit Code Review about 7 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/51976

Actions #12

Updated by Gerrit Code Review about 7 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/51976

Actions #13

Updated by Gerrit Code Review about 7 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/51976

Actions #14

Updated by Gerrit Code Review about 7 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/51976

Actions #15

Updated by Gerrit Code Review about 7 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51976

Actions #16

Updated by Benni Mack about 7 years ago

  • Target version changed from 8 LTS to Candidate for patchlevel
Actions #17

Updated by Gerrit Code Review about 7 years ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51976

Actions #18

Updated by Kevin Ditscheid about 7 years ago

I still get an error when trying to add a new record via the add-wizard button.
I've tried to test the patches from the review system by fetching the commit via git, composer install and setup the fresh system via install procedure in the browser and installing the test extension provided via extension manager.
I also did download the current 8.7.2-dev and applied the patchfile manually with no success.
I captured a screenshot of the error and the stacktrace !screenshot-typo3review.dev 2017-04-21 10-25-50.png!

Actions #19

Updated by Gerrit Code Review almost 7 years ago

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

Actions #20

Updated by Kevin Ditscheid almost 7 years ago

I've to update this again with some questions of mine.
It seems that this issue has resolved itself nowadays, because in all 3 of the current TYPO3 branches, master, 8.7 and 7.6, the behaviour has changed when clicking the "Add new" Button of the wizard.
Instead of silently trashing the selection, the FormEngine now warns you with an alert like when leaving the record by closing it with unsaved changes. This not only resets the selection of items since the last item has been added, but since the record has been saved last. So, the wizard isn't treated as a kinda "popup" anymore, but as a "leaving the record" request. For me this would render this issue and the patches irrelevant and requires a new discussion about rather the current behaviour of leaving the record entirely is a good or a bad one.

Just for the record: The way of introducing add-buttons has changed in v8.7, too, because there are field controls now. I am unable to say whether or not this new type of configuration uses the same wizard logic, but it is causing the same behaviour as I described above.

So how to handle this issue now?

Actions #21

Updated by Thomas Hohn almost 7 years ago

Could you please add the TCA configuration that works for you and then I'll have a look at it

Actions #22

Updated by Kevin Ditscheid almost 7 years ago

Thomas Hohn wrote:

Could you please add the TCA configuration that works for you and then I'll have a look at it

The test extension does exactly what I described in 7.6 on latest master. And from there on out, all methods of including an add wizard do.
You could also test it via the styleguide extension.

Actions #23

Updated by Kevin Ditscheid almost 7 years ago

Sry for the late update on this:
After testing this issue again with a little time to look over it freshly, I discovered that I only tested with new records, not with existing ones.
For existing ones, the patch works totally fine.
However, for new records, the behaviour still is a different one in my tests.

Actions #24

Updated by Gerrit Code Review almost 7 years ago

Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51976

Actions #25

Updated by Gerrit Code Review almost 7 years ago

Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51976

Actions #26

Updated by Gerrit Code Review almost 7 years ago

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/53414

Actions #27

Updated by Gerrit Code Review almost 7 years ago

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

Actions #28

Updated by Thomas Hohn almost 7 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 30 to 100
Actions #29

Updated by Kevin Ditscheid almost 7 years ago

  • Has duplicate Bug #81824: Wizards add not working with MM added
Actions #30

Updated by Georg Ringer almost 7 years ago

  • Related to Bug #81855: Add new record wizard fails on Save&Close with "select" field and MM setted added
Actions #31

Updated by XIMA MEDIA GmbH over 6 years ago

It seems the new version 7.6.21 does not fix this bug as mentioned in the changelog (https://wiki.typo3.org/TYPO3_CMS_7.6.21).

My TCA for the add-wizard is configured as in step 2 described here: https://forge.typo3.org/issues/81824 .

Actions #32

Updated by XIMA MEDIA GmbH over 6 years ago

  • Related to Bug #82016: Wizards add still not working with MM added
Actions #33

Updated by Mathias Brodala about 6 years ago

  • Related to Bug #82461: Backend/TCA: fieldControl->addRecord removes old relations after creating an new entry in the foreign table for the new relation added
Actions #34

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF