Review main Merged

15898[FEATURE] stdWrap replacement: add optionSplit-support

Stefan Neufeind CR +2 V +2 Normal +66 −5 updated 07/29/13, 22:42

Commit message

With optionSplit the "replace"-parameter can be
different depending on the occurence of the string
(first/middle/last-part, ...).

Review

  • Code review CR +2
    • Stefan Neufeind +2
    • Wouter Wolters +1
  • Verified V +2
    • Stefan Neufeind +2
    • Wouter Wolters +1

Issues 1

Files 2

Review log 42

Show 17 earlier messages
  1. Stefan Neufeind uploaded patch set 2 05/27/13, 17:19

    ContentObjectRenderer.php:4406

    For cases where stdWrap possibly changes the value of "replace" (where replace has subparameters), how is it expected to behave? At this point stdWrap was already executed on "replace" to possibly calcuate it's value and optionSplit is done afterwards here. Is optionSplit designed to take place like this? Or is it intended to first do the optionSplit while keeping the whole partial tree (consisting of "replace" and "replace.") and doing the stdWrap afterwards on each individual item?
  2. Stefan Neufeind commented on patch set 2 05/27/13, 17:19

    (1 inline comment) Enjoy :-) I just have one small question inline how optionSplit and stdWrap are expected to interact.
  3. Stefan Neufeind commented on patch set 2 05/27/13, 17:19

    @Christopher: For sure there will be updated tsref. But the feature itself, the parameter-name or whatever is not yet fixed. Instead of being beaten with a friendly "-1" I would have hoped for your opinion on the feature and the patch itself :-(
  4. Stefan Neufeind commented on patch set 2 05/27/13, 17:19

    I still didn't manage to find out how/where/... to exactly submit that documentation :-( Could somebody please bring forward a (small) doc-patch, submit it etc. and we could continue with this patch here? It's sad to see that all it's missing for *months* is a way to document the stuff.
  5. Stefan Neufeind commented on patch set 2 05/27/13, 17:19

    Any news on the docs, Philipp?
  6. Stefan Neufeind commented on patch set 2 05/27/13, 17:19

    Please consider this!
  7. Stefan Neufeind commented on patch set 2 05/27/13, 17:19

    Problem Wouter encountered seems to be because of anonymous functions with preg_replace_callback in PHP 5.3.x. Only works in 5.4+ according to comments in the php-docs. Expect a followup soon.
  8. Benni Mack commented on patch set 2 05/27/13, 17:19

    Fails; Looks good to me, but someone else must approve If i set useOptionSplitReplace = 0 the replacement does not work anymore as before.
  9. Benni Mack uploaded patch set 3 05/27/13, 17:19

  10. Benni Mack commented on patch set 3 05/27/13, 17:19

    This is a WIP as the !isset() and the !empty() changes should be improved in the other cases.
  11. Christian Kuhn commented on patch set 2 05/27/13, 17:19

    No score Forget my comment ... wrong patch...
  12. Christian Kuhn commented on patch set 2 05/27/13, 17:19

    Fails Unit test fails: 1) TYPO3\CMS\Form\Tests\Unit\Domain\Factory\TypoScriptFactoryTest::stdWrapIsAppliedToElementValue Failed asserting that two strings are identical. --- Expected +++ Actual @@ @@ -ABCsomethingDEF +
  13. Chris topher commented on patch set 2 05/27/13, 17:19

    Hi Stefan, I don't have any problem with your patch, but unfortunately it's a fact that documentation sometimes is forgotten. I am currently updating TSref and I can tell you it is rather annoying having to write mails to people asking them, what exactly they wanted to achieve with their patches. I only want to make sure that documentation is taken care for here as well. :-) I would have given you my opinion on the internals inside your changes, but due to lack of knowledge concerning the exact TypoScript internals I think that I cannot be a big help there right now. Sorry for that. :-(
  14. Chris topher commented on patch set 2 05/27/13, 17:19

    I would prefer that you didn't submit this Please push the updated documentation for TSref, best also with an example usecase: http://forge.typo3.org/projects/typo3v4-doc_core_tsref
  15. Philipp Gampe commented on patch set 2 05/27/13, 17:19

    OK, forget the last comment. The test is already included ... I will create the plain text doc for the issue and I will also test this one.
  16. Philipp Gampe commented on patch set 2 05/27/13, 17:19

    oops ... to many open tickets ;) I just moved it.
  17. Philipp Gampe commented on patch set 2 05/27/13, 17:19

    policy is to push both code and documentation at the same time and to include a dependecy in the doc patch.
  1. Philipp Gampe commented on patch set 2 05/27/13, 17:19

    Please create a (documented) example and attach it to the issue. If you have some time, please make a unit test out of it ;) For the moment, please drop the doc patch idea; it is nice, but procedure has to be finished first. Just attach a plain text ready to be documented to the issue and create a linked doc issue.
  2. Philipp Gampe commented on patch set 2 05/27/13, 17:19

    Looks good to me, but someone else must approve
  3. Philipp Gampe voted on patch set 2 V 0 05/27/13, 17:19

  4. Anja Leichsenring commented on patch set 2 05/27/13, 17:19

    Verified; Looks good to me, but someone else must approve works, only the doku patch is still missing.
  5. Mr. Jenkins commented on patch set 1 05/27/13, 17:19

  6. Mr. Jenkins commented on patch set 2 05/27/13, 17:19

  7. Mr. Jenkins commented on patch set 3 05/27/13, 17:19

  8. Wouter Wolters commented on patch set 2 05/27/13, 17:19

    @stefan: I already wrote a message to Philipp about it but it is placed at a other ticket in Forge. See http://forge.typo3.org/issues/36067#change-154025
  9. Wouter Wolters commented on patch set 2 05/27/13, 17:19

    Fails replacement with data set "replacement with optionSplit, normal pattern" Failure in test case replacement with data set "replacement with optionSplit, normal pattern" File: typo3/sysext/frontend/Tests/Unit/ContentObject/ContentObjectRendererTest.php Line: 1053 Failed asserting that two strings are equal. 'Thereisacat,adogandatigerindahood!Yeah!' 'There1is2a3cat,3a3dog3and3a3tiger3in3da3hood!3Yeah!' replacement with data set "replacement with optionSplit, using regex" Failure in test case replacement with data set "replacement with optionSplit, using regex" File: typo3/sysext/frontend/Tests/Unit/ContentObject/ContentObjectRendererTest.php Line: 1053 Failed asserting that two strings are equal. 'There is , a tiny cat, a midsized dog and a big tiger in da hood! Yeah!'
  10. Stefan Neufeind commented on patch set 3 06/13/13, 20:40

    Could somebody please take a closer look to get this ball rolling again?
    6.2
  11. Stefan Galinski commented on patch set 3 V -1 06/17/13, 18:17

    Neither the unit test nor a manual test worked.
  12. Stefan Neufeind uploaded patch set 4 06/17/13, 23:31

  13. Mr. Jenkins commented on patch set 4 06/17/13, 23:32

  14. Stefan Neufeind commented on patch set 4 06/17/13, 23:33

    In patchset 3 it got broken when Benni introduced the empty-check. Needed to be negated. Testcase runs fine again now. @Benni: What else did you want to change, since you mentioned it's WIP? Could you please either shortly go ahead or just get back to me directly maybe so we can clear this up?
  15. Anja Leichsenring commented on patch set 4 V +1 CR +1 06/20/13, 18:30

    just let it get in.
  16. Wouter Wolters commented on patch set 4 V -1 CR -1 06/20/13, 18:37

    Still fails on 5.3 Failed asserting that two strings are equal. 'Thereisacat,adogandatigerindahood!Yeah!' 'There1is2a3cat,3a3dog3and3a3tiger3in3da3hood!3Yeah!' Failed asserting that two strings are equal. 'There is , a tiny cat, a midsized dog and a big tiger in da hood! Yeah!'
  17. Stefan Neufeind commented on patch set 4 07/09/13, 09:22

    @Wouter: Can't reproduce your error. Does it (still) exist for you? Is it a problem with PHP 5.3 only? My distri has 5.4 meanwhile so I can't easily test that locally against 5.3 here.
    6.2
  18. Wouter Wolters commented on patch set 4 07/09/13, 09:37

    Offcourse it still exists for me otherwise I'm not downvoting this issue;)
  19. Stefan Neufeind commented on patch set 4 07/10/13, 07:36

    I expect the problem on 5.3 is with the anonymous function (preg_callback). Although they should afaik be available since 5.3 already, maybe there is something that works this way only since 5.4? Can't test though due to no 5.3. Would be really really greaet if you could take a closer look.
  20. Nicole Hummel uploaded patch set 5 07/29/13, 16:32

  21. Mr. Jenkins commented on patch set 5 07/29/13, 16:33

  22. Nicole Hummel commented on patch set 4 07/29/13, 16:34

    You simply forgot the third parameter which is needed in PHP 5.3
  23. Wouter Wolters commented on patch set 5 V +1 CR +1 07/29/13, 16:47

    Verified with the unit-tests on PHP 5.3
  24. Stefan Neufeind commented on patch set 5 V +2 CR +2 07/29/13, 22:42

    Thanks Nicole for debugging and the small adjustment. Wouter confirmed it now also works for him on PHP 5.3.x (and it worked for Nicole as well). Anjas votes still apply as well. Tested myself again as well using the tests, just to be sure.
  25. Stefan Neufeind merged patch set 6 07/29/13, 22:42