58421[BUGFIX] Correct inline foreign_unique with target type="group" handling
Commit message
Review
-
Code review CR +2
- Anja Leichsenring +2
- Christian Kuhn +1
- Cyril Janody +1
-
Verified V +2
- Anja Leichsenring +2
- Christian Kuhn +1
- Cyril Janody +1
- TYPO3com +1 CI
Issues 2
Files 2
Review log 2125
-
Cyril Janody uploaded patch set 1 09/27/18, 23:43
-
TYPO3com voted on patch set 1 V +1 09/27/18, 23:51 Completed build in 08m 46s on Fri, 28 Sep, 01:51 AM Test Summary: 36076 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-28772
-
Cyril Janody rebased onto patch set 2 09/28/18, 17:36
-
TYPO3com voted on patch set 2 V +1 09/28/18, 17:47 Completed build in 10m 46s on Fri, 28 Sep, 07:47 PM Test Summary: 36121 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-28824
-
Nicole Hummel commented on patch set 2 CR -1 09/29/18, 10:25
As noted in the else part: group values may have table information that need to be processed before you can use those values. -
Cyril Janody commented on patch set 2 09/29/18, 16:24
> As noted in the else part: group values may have table information > that need to be processed before you can use those values. Hi Nicole, Ok, could you please give me an example of configuration? My understanding is that the FormDataProvider parses "group" as "select" fields now. I left the "else" part but I'm pretty sure the condition could be removed... Regards -
Christian Kuhn commented on patch set 2 10/10/18, 13:25
https://review.typo3.org/#/c/56670/ comes with a similar solution. -
Nicole Hummel commented on patch set 2 10/10/18, 13:39
As far as I can see in \TYPO3\CMS\Backend\Form\FormDataProvider\TcaGroup items of group elements are not compatible to items of select elements. items of group are arrays like $items[] = [ 'table' => $tableName, 'uid' => $record['uid'], 'title' => $title, 'row' => $record, ]; -
Christian Kuhn commented on patch set 2 10/10/18, 13:57
thanks to cyril, this is now testable with "inline mngroup" in styleguide git master. -
Cyril Janody commented on patch set 2 10/10/18, 17:33
Hi Nicole, you're right but in both case, it's an array without predefined keys. In TcaGroup.php, as you said, we have : $items[] = [ 'table' => $tableName, 'uid' => $record['uid'], 'title' => $title, 'row' => $record, ]; And in TcaSelectItems.php : $fieldConfig['config']['items'] = array_values($fieldConfig['config']['items']); That's why I think the condition could be safely removed here. -
Christian Kuhn commented on patch set 2 CR -1 10/11/18, 11:09
working on it. -
Christian Kuhn commented on patch set 2 10/11/18, 11:28
first, there are 3 scenarious in ext:styleguide to play around, debug and breakpoint on this, those that use 'foreign_unique': * inline_usecombination (select_child in mm table is a type=select) * inline_usecombinationbox (same as above, just slightly different output) * inline_mngroup (childid in mm table is a type=group) -
Christian Kuhn commented on patch set 2 10/11/18, 11:29
next, its true that both select & group are *always* resolved to an array of items, so the else part of the existing code is clearly broken and needs adaption. -
Christian Kuhn commented on patch set 2 10/11/18, 11:35
InlineControlContainer.php:205this however is problematic with group: group items are resolved to an array having uid,table,title and row as items. assingning the entire thing to $value thus adds title+row in comparison to what the 'else' part did before (only uid+table). the issue is that the $uniqueIds stuff is also pushed to the javaScript since jsfunc.inline.js works on in. with given patch suggestion we thus end up with additionally having title+row in js - this should be avoided. i'll thus slightly change the patch to keep the $type===select, but will change the else part.InlineControlContainer.php:217this is actually used and acted upon within js - i'll adapt that comment a bit to make that more clear. -
Christian Kuhn uploaded patch set 3 10/11/18, 12:16
-
Christian Kuhn updated the commit message in patch set 4 10/11/18, 12:17
-
TYPO3com voted on patch set 3 V +1 10/11/18, 12:29 Completed build in 12m 49s on Thu, 11 Oct, 02:29 PM Test Summary: 37801 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-29420
-
TYPO3com voted on patch set 4 V +1 10/11/18, 12:35 Completed build in 14m 38s on Thu, 11 Oct, 02:35 PM Test Summary: 37801 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-29421
-
Christian Kuhn voted on patch set 4 V +1 CR +1 10/11/18, 12:35
-
Cyril Janody commented on patch set 4 V +1 CR +1 10/11/18, 13:01
Good job. -
Nicole Hummel commented on patch set 4 10/11/18, 13:14
InlineControlContainer.php:217is there any problem in having more options in this value then necessary? Just thinking if we might can use array_shift in both cases? -
Anja Leichsenring voted on patch set 4 V +2 CR +2 10/11/18, 18:25
-
Anja Leichsenring merged patch set 5 10/11/18, 18:25
-
Christian Kuhn commented on patch set 4 10/12/18, 08:54
InlineControlContainer.php:217ReplyYes. I tried to explain that in the comment with "we don't need and want the title and the entire row data in the frontend". Do you think better phrasing is needed? -
Nicole Hummel commented on patch set 5 10/17/18, 21:32
I would go for a different approach here. The incoming value is an array. And we need to have only the first value available. There is no need to make a difference between select and group. The rendering of this first value is done somewhere else in the code. The rendering differs if it's a select and a group field. For the group field we then know what incoming value we have and that we only need two of four values. In my opinion this would reduce type specific code when fetching the first value and would move the separate handling in the already available rendering function.