Review main Merged

50142[FEATURE] Add stdWrap to config.additionalHeaders

Philipp Gampe CR +2 V +2 Normal +137 −21 updated 10/01/18, 09:37

Commit message

Add stdWrap to the elements header, replace and httpResponseCode.

Review

  • Code review CR +2
    • Susi Moog +2
    • Georg Ringer +1
    • Sascha Rademacher +1
    • Henning Liebe +1
    • Jörg Bösche +1
  • Verified V +2
    • Susi Moog +2
    • Georg Ringer +1
    • TYPO3com +1 CI

Issues 2

Files 3

Review log 3241

Show 1316 earlier messages
  1. Philipp Gampe uploaded patch set 1 10/08/16, 21:26

  2. TYPO3com voted on patch set 1 V +1 10/08/16, 21:30 Completed build in 03m 58s on Sat, 8 Oct, 11:30 PM Test Summary: 19516 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-3497

  3. Helmut Hummel commented on patch set 1 10/15/16, 19:10

    iirc there was a reason, why currently no config option has stdWrap. it was some caching, early bootstrap and chicken / egg problem. For additionalHeaders it might work, but for other properties not, so question is, if we want stdWrap for some. If you ask me, I'd say no, but I also won't veto here

    TypoScriptFrontendController.php:3534

    rather "sendAdditonalHeaders"

    TypoScriptFrontendController.php:4795

    all options might not be set, thus this code will throw additional notices

    TypoScriptFrontendController.php:4809

    if $options['replace'] is not set the $replace will be null and this condition will be true.
  4. Philipp Gampe commented on patch set 1 10/16/16, 17:50

    I share your concerns about config., however in this case the code is only called after rendering, which circumvents the problem. The chicken/egg problem here is that $this->cObj is not set when some parts of config. are evaluated. IMHO the benefit over a more fine-grained header control outweighs the inconsistency with stdWrap for config.

    TypoScriptFrontendController.php:4809 Reply

    This is by design. Everything except "0" should make it true.
  5. Philipp Gampe uploaded patch set 2 11/05/16, 18:13

  6. Philipp Gampe commented on patch set 1 11/05/16, 18:14

    TypoScriptFrontendController.php:3534 Reply

    Done

    TypoScriptFrontendController.php:4795 Reply

    Done
  7. Philipp Gampe commented on patch set 1 11/05/16, 18:15

    You can test this with config.additionalHeaders { 10.header = foo: 10.header.dataWrap = |{page:uid} }
  8. TYPO3com voted on patch set 2 V -1 11/05/16, 18:20 Completed build in 07m 31s on Sat, 5 Nov, 07:20 PM Test Summary: 54839 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-4638

  9. Philipp Gampe commented on patch set 3 11/07/16, 19:22

    Published edit on patch set 2.
  10. TYPO3com voted on patch set 3 V +1 11/07/16, 19:27 Completed build in 04m 21s on Mon, 7 Nov, 08:27 PM Test Summary: 55235 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-4686

  11. Manuel Glauser commented on patch set 3 12/04/16, 10:23

    TypoScriptFrontendController.php:4809 Reply

    This means workarounds, if somebody uses stdWrap functions such as 'if' or 'required', which return empty strings immediately, when the conditions don't apply. I think, we should either leave it as is (add more explicit definition in the documentation in this case?), or we interpret the stdWrap return value more loosely.
  12. Manuel Glauser voted on patch set 3 CR +1 12/04/16, 10:23

  13. Jörg Bösche voted on patch set 3 CR +1 12/06/16, 07:36

  14. Philipp Gampe commented on patch set 1 12/28/16, 12:10

    TypoScriptFrontendController.php:4809 Reply

    Well, I did not touch what was there before. You think we should allow empty strings as well?
  15. Manuel Glauser commented on patch set 3 CR 0 12/29/16, 07:29

    TypoScriptFrontendController.php:4809 Reply

    Yes and no. I think we should go for a boolean value and cast the "$replace" value accordingly, instead of explicitly asking the value to be '0'. This - in my opinion - would make it more compliant with the current standards and interpretation (by integrators) of most other "string/stdWrap" values in TypoScript. Should I suggest a patch?
  16. Philipp Gampe commented on patch set 1 12/30/16, 15:48

    TypoScriptFrontendController.php:4809 Reply

    Well, we cannot simply cast to bool, because Null (not set) means True too, as True is the default value. We could inverse the condition and check for empty string and '0' directly, but anything more should be handled with an own patchset. I would like to get this one in before.
  1. Philipp Gampe rebased onto patch set 4 12/30/16, 15:48

  2. Philipp Gampe updated the commit message in patch set 5 12/30/16, 15:49

  3. TYPO3com voted on patch set 4 V +1 12/30/16, 15:53 Completed build in 04m 44s on Fri, 30 Dec, 04:53 PM Test Summary: 54417 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-6081

  4. TYPO3com voted on patch set 5 V +1 12/30/16, 15:54 Completed build in 04m 52s on Fri, 30 Dec, 04:54 PM Test Summary: 54417 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-6082

  5. Manuel Glauser commented on patch set 5 12/31/16, 08:00

    That would be a really welcome addition to this, I think! It might produce unexpected results else (and of course a simple type-casting without catching 'edge'-cases won't do the trick :) ).
  6. Philipp Gampe commented on patch set 5 01/20/17, 13:05

    Would you mind reviewing the current state, so this has a chance for 8.x
  7. Markus Klein commented on patch set 5 01/20/17, 14:47

    TypoScriptFrontendController.php:4812

    move it before the getters for globals above.

    TypoScriptFrontendController.php:4814

    make it an early return.

    TypoScriptFrontendController.php:4832

    use isset(). if the key exists its value is for sure never null, hence we don't need the slow array_key_exists call

    TypoScriptFrontendController.php:4841

    no need for the parenthesis
  8. Philipp Gampe uploaded patch set 6 01/29/17, 13:10

  9. Philipp Gampe commented on patch set 5 01/29/17, 13:10

    TypoScriptFrontendController.php:4812 Reply

    Done

    TypoScriptFrontendController.php:4814 Reply

    Done

    TypoScriptFrontendController.php:4832 Reply

    I changed it for all three places. Do to the nature of TS, there must always be an array there.

    TypoScriptFrontendController.php:4841 Reply

    Done
  10. TYPO3com voted on patch set 6 V +1 01/29/17, 13:15 Completed build in 05m 22s on Sun, 29 Jan, 02:15 PM Test Summary: 55655 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-7183

  11. Jörg Bösche voted on patch set 6 CR +1 03/13/17, 22:34

  12. Philipp Gampe rebased onto patch set 7 05/09/17, 15:56

  13. TYPO3com voted on patch set 7 V -1 05/09/17, 16:01 Completed build in 05m 24s on Tue, 9 May, 06:01 PM Test Summary: 55794 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-11320

  14. Philipp Gampe uploaded patch set 8 05/09/17, 16:12

  15. TYPO3com voted on patch set 8 V +1 05/09/17, 16:18 Completed build in 05m 48s on Tue, 9 May, 06:18 PM Test Summary: 55794 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-11323

  16. Philipp Gampe rebased onto patch set 9 06/03/17, 08:43

  17. TYPO3com voted on patch set 9 V +1 06/03/17, 08:51 Completed build in 07m 40s on Sat, 3 Jun, 10:51 AM Test Summary: 55931 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-12169

  18. Georg Ringer voted on patch set 9 CR +1 V +1 06/29/17, 10:59

  19. Jörg Bösche voted on patch set 9 CR +1 06/30/17, 18:54

  20. Sascha Rademacher voted on patch set 9 CR +1 08/14/17, 09:38

  21. Henning Liebe voted on patch set 9 CR +1 08/14/17, 09:39

  22. Susi Moog voted on patch set 9 CR +2 V +2 08/14/17, 13:27

  23. Gerrit merged patch set 9 08/14/17, 13:28

  24. Benjamin Franzke commented on patch set 10 10/01/18, 07:57

    TypoScriptFrontendController.php:4580 Unresolved

    TSFE->cObj is not always available. When a page is read from cache, TSFE->cObj is not initialized. See related bug report: https://forge.typo3.org/issues/86492
  25. Markus Klein wrote 10/01/18, 09:37

    Created a revert of this change as Ia7caf3770b12737fd195da9d9f66bdc179981de8