Review main Abandoned

66872[FEATURE] Add registration for DataProcessor

Thomas Löffler CR 0 V 0 Normal +97 −1 updated 11/11/21, 10:41

Commit message

The registration makes it possible to use a short syntax for
all DataProcessor classes.
Adding new DataProcessor is easy possible by adding to the array
$GLOBALS['TYPO3_CONF_VARS']['FE']['dataProcessing'].

Review

  • Code review CR 0
  • Verified V 0

Issues 1

Files 4

Review log 913

  1. Thomas Löffler uploaded patch set 1 11/23/20, 17:05

  2. TYPO3com voted on patch set 1 V +1 11/23/20, 17:17 Completed build in 11m 47s on Mon, 23 Nov, 05:17 PM Test Summary: 32393 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-7524

  3. Thomas Löffler updated the commit message in patch set 2 11/24/20, 07:13

  4. TYPO3com voted on patch set 2 V +1 11/24/20, 07:25 Completed build in 11m 13s on Tue, 24 Nov, 07:25 AM Test Summary: 32393 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-7532

  5. Thomas Löffler uploaded patch set 3 11/24/20, 07:35

  6. TYPO3com voted on patch set 3 V -1 11/24/20, 07:48 Completed build in 12m 48s on Tue, 24 Nov, 07:48 AM Test Summary: 30856 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-7533

  7. Thomas Löffler uploaded patch set 4 11/24/20, 07:58

  8. TYPO3com voted on patch set 4 V +1 11/24/20, 08:09 Completed build in 10m 38s on Tue, 24 Nov, 08:09 AM Test Summary: 32392 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-7534

  9. Christian Kuhn commented on patch set 4 CR -1 11/24/20, 18:50

    Feature-92910-AddDataProcessorRegistration.rst:33

    I'm not sure if I'm a fan of this approach. This line shows why: Within a short timeframe, multiple extensions will register their own "CustomProcessor", possibly accidentially overriding a CustomProcessor from a different extension. Thus, you'd need at least a 'namespace' recommendation here - by prefixing processors with extKey for instance. So, when 'simple overrinding' is your priority, I'd pick the class names a key (at least for core registrations) and the value as actual implementation. If "I don't want class names in typoscript" is your priority, then the naming scheme for keys should be changed to not easily collide with other extensions, and it will have the additional drawback of adding a layer of indirection - you need to look up it typo3_conf_vars which class is responsible to see the implementation. As a matter of fact, I actually don't understand why there is a data processor registry *at all*: data processors must implement DataProcessorInterface anyway - Any class that implements it could be referenced in TS. so the registry could be dropped? If then some extension really needs to override a data processor (for instance to fix a bug), it would register an xclass. In this case, one would dispense the 'short' syntax which can easily lead to trouble if not properly namespaced anyway, and simply keep the class names: It's easy and straight forward - especially for typoscript devs who have seen php at least once in their live.
  10. Christian Kuhn commented on patch set 4 11/24/20, 18:59

    Feature-92910-AddDataProcessorRegistration.rst:33 Reply Unresolved

    Ah, got that right now: You're actually adding this array to typo3_conf_vars with this patch. I'd love to not do that: globally overriding a data processor is available already via 'xclass' if really needed for whatever reason, and I don't think having a full class name in TypoScript is a huge drawback. At least they allow me to easily find the implementation of a processor without further trouble. I don't see why should alias this, except the fact that this is less to type for a TypoScript dev: It makes TypoScript more opaque and adds naming trouble.
  11. Georg Ringer commented on patch set 4 CR -1 11/24/20, 21:27

    Feature-92910-AddDataProcessorRegistration.rst:37 Unresolved

    I really don't like because of following reasons: - If I want to be consistent, now I need to add every DataProcessor to the $GLOBALS as well, even if only used once - If I check out a project which I don't know by heart, I *always* need to check out $globals as well which brings me to the next one: - the configuration might be in LocalConfiguration, it can be in one those AdditionalConfiguration_Production_Live.php files or in an ext_localconf.php of a site extension - PhpStorm let me (I guess because of one of those great plugins) click on the class and it will open right aways. this won't work then anymore
  12. Benni Mack commented on patch set 4 11/11/21, 10:41

    I think this approach is better... https://review.typo3.org/c/Packages/TYPO3.CMS/+/72029 - the container keeps all the data processors, makes much more sense.
  13. Benni Mack abandoned the change 11/11/21, 10:41

    see my comment