Bug #82016

Wizards add still not working with MM

Added by XIMA MEDIA GmbH about 2 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
FormEngine aka TCEforms
Target version:
-
Start date:
2017-08-01
Due date:
% Done:

0%

TYPO3 Version:
7
PHP Version:
7.0
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

It seems the new version 7.6.21 does not fix this bug (https://forge.typo3.org/issues/76863) 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 .


Related issues

Related to TYPO3 Core - Bug #76863: MM Relation with selectMultipleSideBySide Field - Add wizard resets the MM Relation Closed 2016-06-29
Related to TYPO3 Core - Bug #81855: Add new record wizard fails on Save&Close with "select" field and MM setted Closed 2017-07-13
Duplicates TYPO3 Core - Bug #81824: Wizards add not working with MM Closed 2017-07-10
Duplicated by TYPO3 Core - Bug #82461: Backend/TCA: fieldControl->addRecord removes old relations after creating an new entry in the foreign table for the new relation Closed 2017-09-12

History

#1 Updated by XIMA MEDIA GmbH about 2 years ago

  • Related to Bug #76863: MM Relation with selectMultipleSideBySide Field - Add wizard resets the MM Relation added

#2 Updated by XIMA MEDIA GmbH about 2 years ago

  • Duplicates Bug #81824: Wizards add not working with MM added

#3 Updated by Fabian Bett about 2 years ago

I can confirm this problem on Typo3 8.7.4 LTE

A dirty quick fix:

File: sysext\backend\Classes\Controller\Wizard\AddController.php
Method: main

SEARCH:

$currentValue = $currentParentRow[$this->P['field']];
if (is_array($currentValue)) {
    $currentValue = implode(',', array_column($currentValue, 'uid'));
}

REPLACE:

$currentValue = $currentParentRow[$this->P['field']];
if (is_array($currentValue)) {

  $arrayToImplode = array_column($currentValue, 'uid');

  if(count($arrayToImplode) == 0 && count($currentParentRow[$this->P['field']]) > 0) {
    $arrayToImplode = $currentValue;
    foreach($arrayToImplode as $key => $elementId) {
      if(!is_array($elementId) && !is_object($elementId))
      $arrayToImplode[$key] = $this->table . '_' . $elementId;
    }
  }
  $currentValue = implode(',', $arrayToImplode);
}

I think, there is also a conceptual problem:
A wizard controller should not be able to modify a relationship as much as it is implemented here - especially it should not be necessary to convert an array to a string and back.

#4 Updated by XIMA MEDIA GmbH about 2 years ago

Thank you for your response, Fabian.

We'll see what we can do.

#5 Updated by Kevin Ditscheid about 2 years ago

FYI: I added the hotfix by Fabian to the extension I wrote earlier in https://forge.typo3.org/issues/76863#note-5 for this project of mine, but I was unable to replicate the problem, so this is just a shot into the blue I must admit.
Could someone post a reproducible test case for this?

The updated add_wizard hotfix extension can be found on github and packagist:
https://packagist.org/packages/kevinditscheid/add-wizard

#6 Updated by Riccardo De Contardi almost 2 years ago

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

#7 Updated by Susanne Moog over 1 year ago

  • Category changed from DataHandler aka TCEmain to FormEngine aka TCEforms

#8 Updated by Gerrit Code Review over 1 year 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/55779

#9 Updated by Gerrit Code Review over 1 year 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/55779

#10 Updated by Gerrit Code Review over 1 year 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/55779

#11 Updated by Kevin Ditscheid over 1 year ago

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

#12 Updated by Kevin Ditscheid over 1 year ago

Solved in #82461 please close

#13 Updated by Riccardo De Contardi over 1 year ago

  • Status changed from Under Review to Closed

@Kevin Ditscheid thank you for your feedback - closed.

If you think that this is the wrong decision or experience the issue again, please reopen it or open a new issue with a reference to this one.

Also available in: Atom PDF