Review main Abandoned

57355[FEATURE] Provide contentObjectData in all extbase extensions

Georg Ringer CR 0 V 0 Easy +37 −1 updated 11/06/18, 06:50

Commit message

The database row of the current plugin of an extbase extension plugin
is now provided in the templates with the variable name `{contentObjectData}`.

Review

  • Code review CR 0
  • Verified V 0

Issues 1

Files 3

Review log 1214

  1. Georg Ringer uploaded patch set 1 06/24/18, 11:52

  2. TYPO3com voted on patch set 1 V -1 06/24/18, 12:00 Completed build in 07m 45s on Sun, 24 Jun, 02:00 PM Test Summary: 3 of 32977 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-24806

  3. Frans Saris voted on patch set 1 CR +1 06/24/18, 12:24

  4. Benjamin Kott commented on patch set 1 06/24/18, 15:42

    ActionController.php:391

    can we change the naming here to data? that would make it behave the same way like fluidtemplate
  5. Georg Ringer commented on patch set 1 06/24/18, 16:07

    things to consider: - it interferes with more extensions which use data as key as well. - "data" is not a good naming - "contentObjectData" is known for quite a few people, e.g also same name in EXT:news
  6. Georg Ringer uploaded patch set 2 06/24/18, 16:13

  7. TYPO3com voted on patch set 2 V +1 06/24/18, 16:22 Completed build in 08m 15s on Sun, 24 Jun, 06:22 PM Test Summary: 32729 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-24815

  8. Stephan Großberndt commented on patch set 2 06/24/18, 17:29

    The performance impact is low? Extbase is slow anyway so additional degradation should be avoided.
  9. Claus Due commented on patch set 2 CR -1 06/24/18, 17:43

    I would not do this. My reasons are: 1. When you render an Extbase plugin not via TS for tt_content but in arbitrary places, the content object is null which will make this code fail with a PHP error due to trying to access "data" property on a non-object. But, even if this was fixed with a condition, the feature itself has limited viability as a universal assignment, because... 2. The content object data only exists in frontend and this code is shared by frontend and backend controllers alike. In the backend, there is usually no content object data at all (if there is, this has been emulated by third parties). 3. The frequency with which you are likely to use this data array is low (only FE, only plugins, and even then only those where you need it) that it is not a tremendous effort to assign the additional variable from the controller action. Personally I think we would do better by changing the way the ConfigurationManager handles the "content object". Currently this code is put in AbstractConfigurationManager but obviously only applies in FE - so at the very least, it calls for a refactoring. Ideally it would be changed to a consistently accessible way of reading the *record* (with the table being arbitrary) that is currently in effect. Or better, provide both the page record and "record being rendered" with a way to determine the table of the "record being rendered" so as to properly support TS that renders pages, content, or other. But I think this patch doesn't help the situation. You might actually be better off by assigning the ConfigurationManager instance so you could do things like {configurationManager.typoScriptSetup.path.to.TS} or {configurationManager.contentObject.data} (with proper conditions so you can avoid falling into the traps I mentioned above).
  10. Helmut Hummel commented on patch set 2 CR -1 06/27/18, 11:17

    I agree with Claus here. Especially in conjunction with https://review.typo3.org/#/c/57357/, we should rather discuss the concept first. Don't get me wrong. I get what it is meant for, but I think we should not take a shortcut here
  11. Jigal van Hemert commented on patch set 2 CR -1 06/28/18, 06:36

    It largely depends on the case whether it's needed or not. It's a single line you can add to your own controller in case it's a plug-in and it's needed. Claus summed it up nicely.
  12. Helmut Hummel commented on patch set 2 CR 0 07/15/18, 13:01

    I won't be able to help out here, thus I'm removing my -1.
  13. Helmut Hummel wrote 07/15/18, 13:01

    Removed reviewer Helmut Hummel.
  14. Georg Ringer abandoned the change 11/06/18, 06:50