Review main Merged

30644[BUGFIX] Unnecessary instantiation of objects in contentObjectRender

Tomas Norre Mikkelsen CR +2 V +2 Easy +11 −2 updated 06/12/14, 11:39

Commit message

Classes implementing the hook cObjTypeAndClass are instantiated each
time a contentObjectRender is created, even if they are not needed.

This patch introduces lazy loading.

Review

  • Code review CR +2
    • Steffen Ritter +2
    • Christian Zenker +1
    • Fabien Udriot +1
    • Xavier Perseguers +1
  • Verified V +2
    • Steffen Ritter +2
    • Christian Zenker +1
    • Xavier Perseguers +1

Issues 1

Files 1

Review log 15

  1. Mr. Jenkins commented on patch set 1 06/10/14, 13:29

  2. Markus Klein commented on patch set 1 06/10/14, 13:29

    6.2 and 6.1 only. 6.0 is rather out of support already and the others have are in "important fix only" mode

    ContentObjectRenderer.php:740

    Do not mix/change types of a single array please! Use a dedicated array for the class registry and cObjHookObjectsArr for the actual objects.
  3. Xavier Perseguers commented on patch set 1 06/11/14, 08:28

    Reply

    According to http://typo3.org/fileadmin/t3org/documents/TYPO3_Release_Agenda_LTS.pdf I would tend to even suggest only 6.2

    ContentObjectRenderer.php:551

    According to what Markus suggested below: add "protected $cObjHookObjectsRegistry;" above (next to $cObjHookObjetsArr)

    ContentObjectRenderer.php:570

    $this->cObjHookObjectsRegistry = array();

    ContentObjectRenderer.php:573

    $this->cObjHookObjectsRegistry[$classsArr[0]] = $classArr[1];

    ContentObjectRenderer.php:738

    missing space before ( => if [space] ( if (!isset($this->cObjHookObjectsArr[$name])) { $this->cObjHookObjectsArr[$name] = GeneralUtility::getUserObj($this->cObjHookObjectsRegistry[$name]); }
  4. Christian Zenker uploaded patch set 2 06/11/14, 12:34

  5. Christian Zenker commented on patch set 2 06/11/14, 12:37

    Fixed the requested code changes. About the supported versions: I discovered and fixed this issue for a customer in 4.5. So should this patch be accepted, I can supply a patch for 4.x. It's as easy as picking cherries.
  6. Xavier Perseguers commented on patch set 2 06/11/14, 12:41

    We are in priority mode security bugfix in 6.1, 4.7 and 4.5, I don't see this as a critical patch that should land to any other version than 6.2.
  7. Mr. Jenkins commented on patch set 2 06/11/14, 12:48

  8. Xavier Perseguers uploaded patch set 3 06/12/14, 07:23

  9. Xavier Perseguers voted on patch set 3 V +1 CR +1 06/12/14, 07:25

  10. Steffen Ritter voted on patch set 3 CR +2 06/12/14, 07:25

  11. Mr. Jenkins commented on patch set 3 06/12/14, 07:37

  12. Fabien Udriot voted on patch set 3 CR +1 06/12/14, 08:22

  13. Christian Zenker voted on patch set 3 V +1 CR +1 06/12/14, 10:38

  14. Steffen Ritter voted on patch set 3 V +2 06/12/14, 11:39

  15. Steffen Ritter merged patch set 4 06/12/14, 11:39