Review main Merged

67917[TASK] Extend itemsProcFunc parameters for parent related information

Nikita Hovratov CR +2 V +2 Normal +112 −0 updated 04/27/21, 17:50

Commit message

The parameters array of TCA itemsProcFunc is extended for
several (inline) parent table related properties. These are
especially useful for manipulation of the items array, depending
on e.g. the parents' record type.

Additional properties added:

* inlineParentUid
* inlineParentTableName
* inlineParentFieldName
* inlineParentConfig
* inlineTopMostParentUid
* inlineTopMostParentTableName
* inlineTopMostParentFieldName

Review

  • Code review CR +2 Done
    • Anja Leichsenring +2
    • Oli Bartsch +1
    • Christian Kuhn +1
    • Nikita Hovratov +1
  • Verified V +2 Done
    • Anja Leichsenring +2
    • Oli Bartsch +1
    • Christian Kuhn +1
    • Nikita Hovratov +1
    • core-ci +1 CI

Issues 1

Files 4

Review log 3245

Show 1420 earlier messages
  1. Nikita Hovratov uploaded patch set 1 02/13/21, 18:45

  2. TYPO3com voted on patch set 1 V +1 02/13/21, 18:53 Completed build in 08m 21s on Sat, 13 Feb, 06:53 PM Test Summary: 32611 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-9520

  3. core-ci voted on patch set 1 V +1 02/13/21, 18:55 Core CI is happy: https://core.b13.com/typo3-core/typo3.cms/-/pipelines/708

  4. Martin Kutschker commented on patch set 1 04/22/21, 17:41

    Unresolved

    AbstractItemProvider.php:74

    I think calling it simply "parentTable" is enough.
  5. Benni Mack commented on patch set 1 04/22/21, 20:18

    AbstractItemProvider.php:74 Reply

    I agree. Also: Can we also add parentUid, parentFieldName and parentConfig, as well as topMostParentUid, topMostParentTableName and topMostParentFieldName? I think we can safely add this to v10 as well - what do you think @masi?
  6. Nikita Hovratov uploaded patch set 2 04/22/21, 20:53

  7. Nikita Hovratov commented on patch set 2 04/22/21, 20:58

    AbstractItemProvider.php:74 Reply

    I added a RST and also the other fields. Backport to v10 would be great indeed.
  8. TYPO3com voted on patch set 2 V +1 04/22/21, 21:01 Completed build in 07m 52s on Thu, 22 Apr, 09:01 PM Test Summary: 33307 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-10815

  9. core-ci voted on patch set 2 V +1 04/22/21, 21:09 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/10617

  10. Oli Bartsch commented on patch set 2 04/22/21, 21:57

    Hi, thanks for the patch. Could you please also add a test to prove, the parameters are provided in the itemsProcFunc. There is already a test case for this which just needs to be extended.
  11. Daniel Goerz commented on patch set 2 04/23/21, 06:46

    For select fields all the new properties are empty, maybe we should only add them when they actually exist (like it is done for flexParentDatabaseRow), this seems unreasonable when using itemsProcFunc for a select field.

    AbstractItemProvider.php:74 Reply

    I dont agree on simply calling it "parentTable", because the itemProcFunc is also used for select fields and this is confusing now, because the incoming array of arguments has a "table" property that is set to the current records table and it has a "parentTable" property that is empty.

    AbstractItemProvider.php:76

    Are those array keys always set?
  12. Nikita Hovratov commented on patch set 2 04/23/21, 06:48

    AbstractItemProvider.php:76 Reply Unresolved

    Yes in FormDataCompiler->initializeResultArray()
  13. Nikita Hovratov commented on patch set 2 04/23/21, 07:01

    AbstractItemProvider.php:74 Reply

    That makes sense. Then adding back "inline" prefix is the way to go.
  14. Nikita Hovratov commented on patch set 2 04/23/21, 07:06

    Reply

    Can you give me a hint where this test case is?

    Reply

    I guess it makes no sense to provide them if not in inline table, yes. Maybe this would save an "isset" in the user code. Personally I would prefer to always have them set, but let's see what the others say.
  15. Oli Bartsch commented on patch set 2 04/23/21, 11:56

    Reply

    Have a look at the `addDataItemsProcFuncReceivesParameters()` functions.

    Reply

    I would prefer to always receive them, even if NULL / empty. In general, user functions, hooks, etc. which dynamically change their transfer parameters, are really bad IMO. Especially because a check in the user code is necessary in any case.

    AbstractItemProvider.php:74 Reply

    +1
  16. Martin Kutschker commented on patch set 3 04/23/21, 12:29

    Published edit on patch set 2.
  17. Martin Kutschker commented on patch set 3 04/23/21, 12:29

    AbstractItemProvider.php:74 Reply Unresolved

    We have now a long list with keys that could be prefixed with "inline" (an internally are). I'm not sure why the consumer of the API will be confused by the lack of the prefix, but what if we add also the type as well. So you know if the conext is an inline record or a select.
  18. Martin Kutschker commented on patch set 4 04/23/21, 12:30

    Published edit on patch set 3.
  19. TYPO3com voted on patch set 3 V +1 04/23/21, 12:36 Completed build in 07m 01s on Fri, 23 Apr, 12:36 PM Test Summary: 33307 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-10829

  20. TYPO3com voted on patch set 4 V +1 04/23/21, 12:36 Completed build in 06m 08s on Fri, 23 Apr, 12:36 PM Test Summary: 33307 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-10830

  1. core-ci voted on patch set 3 V +1 04/23/21, 12:41 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/10643

  2. core-ci voted on patch set 4 V +1 04/23/21, 12:42 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/10644

  3. Nikita Hovratov commented on patch set 4 04/23/21, 12:56

    Reply

    Hmm, I already added them to $input. Without this the tests don't work. Do you mean something else?
  4. Nikita Hovratov uploaded patch set 5 04/23/21, 21:35

  5. TYPO3com voted on patch set 5 V +1 04/23/21, 21:42 Completed build in 07m 09s on Fri, 23 Apr, 09:42 PM Test Summary: 33307 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-10845

  6. core-ci voted on patch set 5 V +1 04/23/21, 21:46 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/10664

  7. Oli Bartsch uploaded patch set 6 04/23/21, 23:38

  8. TYPO3com voted on patch set 6 V +1 04/23/21, 23:46 Completed build in 08m 42s on Fri, 23 Apr, 11:46 PM Test Summary: 33307 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-10848

  9. Oli Bartsch commented on patch set 6 V +1 CR +1 04/23/21, 23:48

    Hi Nikita, thanks for the patch so far. Just improved the commit message and the RST a bit. Also moved it to 10.4.x since this patch will be backported. Furthermore, I added the missing `Name` suffix to the properties. This is IMO important, to prevent introducing inconsistency between differente DataProviders, user functions, etc... Generally, we should always use the initially (FormDataCompiler->initializeResultArray()) defined names.
  10. Nikita Hovratov commented on patch set 6 04/23/21, 23:50

    Reply

    Looks great, thanks for improving the text!
  11. core-ci voted on patch set 6 V +1 04/23/21, 23:50 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/10667

  12. Nikita Hovratov voted on patch set 6 V +1 CR +1 04/23/21, 23:55

  13. Martin Kutschker commented on patch set 6 04/24/21, 14:53

    Reply

    What's the impovement here? Now it is inconsistent with plain "table" and "field" of the existing keys. And contrary I think it is a mistake generally in the TYPO3 API to expose internal names. But we can probably argue here for a long time without consensus.
  14. Oli Bartsch commented on patch set 6 04/24/21, 19:20

    Reply

    Just because we made errors in the past, IMO we don't have to repeat them to be consistence with the inconsistency.
  15. Martin Kutschker commented on patch set 6 04/24/21, 20:09

    Reply

    Depends on what names you like. I prefer the shorter ones anywayy. I don't see a value in the "name" part. But if it is so important I'd add "name" to the old ones as well by duplication and deprecate them. That's because I'm a freak for consistency 😊
  16. Oli Bartsch commented on patch set 6 04/24/21, 21:11

    Reply Unresolved

    Actually I prefer the shorter ones, too. However, since they were initially defined with the `Name` suffix (see: FormDataCompiler->initializeResultArray()) we should always stick to them, so developers can rely on those names everywhere in FormEngine. You're absolutely right, it would be correct to also rename the existing ones. But since this is public API and therefore covered by our backwards-compatibility promise, I'm not quite sure whether the effort would justify the benefit. Anyways, this would be a separate patch.
  17. Christian Kuhn commented on patch set 6 CR -1 04/27/21, 17:25

    Imho not a feature if the hook gets some more data for possible usage. I understand those vars can be useful for itemsProcFunc and support the request for v10, too. I'll change the patch to a TASK and will drop the .rst file.
  18. Christian Kuhn uploaded patch set 7 04/27/21, 17:30

  19. Christian Kuhn voted on patch set 7 V +1 CR +1 04/27/21, 17:37

  20. core-ci voted on patch set 7 V +1 04/27/21, 17:39 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/10753

  21. Nikita Hovratov commented on patch set 7 V +1 CR +1 04/27/21, 17:42

    Reply

    It's something in between I guess. Dropping the rst is ok then, but my fear is people won't know about the new properties. A better place would be to list them in the documentation I suppose.
  22. Anja Leichsenring voted on patch set 7 V +1 CR +1 04/27/21, 17:46

  23. Oli Bartsch voted on patch set 7 V +1 CR +1 04/27/21, 17:49

  24. Anja Leichsenring voted on patch set 7 V +2 CR +2 04/27/21, 17:50

  25. Anja Leichsenring merged patch set 8 04/27/21, 17:50