Review main Merged

44500[BUGFIX] Show warning message on regex error in Object Browser

Mathias Schreiber CR +2 V +2 Easy +31 −4 updated 11/03/15, 21:31

Commit message

We test the pattern with a shutdown operator, before we're going to use it
in the regular expression search.

With doing so, we can output an error message when the regex is wrong.

Review

  • Code review CR +2
    • Stefan Neufeind +2
    • Daniel Goerz +1
  • Verified V +2
    • Stefan Neufeind +2
    • Daniel Goerz +1

Issues 1

Files 3

Review log 22

  1. Mathias Schreiber uploaded patch set 1 11/03/15, 10:59

  2. Andreas Kienast voted on patch set 1 CR +1 V +1 11/03/15, 11:03

  3. Markus Klein commented on patch set 1 11/03/15, 11:07

    Do I read that correctly that this only is something which is helpful if dev-preset is active? preg_match does not throw execptions
  4. Mathias Schreiber commented on patch set 1 11/03/15, 11:09

    yes
  5. Markus Klein commented on patch set 1 11/03/15, 11:12

    ExtendedTemplateService.php:587

    @throws missing

    ExtendedTemplateService.php:619

    What is the type of the exception we receive from preg_match? I suggest to use a more specific exception than one of the most generic exception classes.
  6. Mathias Schreiber uploaded patch set 2 11/03/15, 11:38

  7. Mathias Schreiber commented on patch set 2 11/03/15, 11:39

    it's a warning.
  8. Mathias Schreiber uploaded patch set 3 11/03/15, 11:49

  9. Mathias Schreiber uploaded patch set 4 11/03/15, 11:50

  10. Markus Klein voted on patch set 4 CR +1 V +1 11/03/15, 11:52

  11. Christian Kuhn commented on patch set 4 11/03/15, 12:29

    TypoScriptTemplateModuleController.php:105

    not a fan of this one ... let us at least mark it as @internal ...
  12. Helmut Hummel commented on patch set 1 11/03/15, 12:50

    ExtendedTemplateService.php:607

    is it really a feature that $searchString can be a regex part? if not, I'd rather properly quote it here and disallow regular expressions

    ExtendedTemplateService.php:618

    a PHP warning is not always converted into an exception. it depends on configuration whether or not this happens. we cannot just assume so.

    TypoScriptTemplateModuleController.php:107

    no need to expose this

    TypoScriptTemplateObjectBrowserModuleFunctionController.php:421

    flash messages can be created and added without the module template being exposed
  13. Helmut Hummel commented on patch set 4 CR -1 11/03/15, 12:51

    TypoScriptTemplateModuleController.php:105 Reply

    this must not be exposed. and there is no need for it either

    TypoScriptTemplateObjectBrowserModuleFunctionController.php:414

    I think this still does not throw exceptions in all cases
  14. Helmut Hummel uploaded patch set 5 11/03/15, 14:27

  15. Helmut Hummel uploaded patch set 6 11/03/15, 14:33

  16. Nicole Hummel commented on patch set 6 11/03/15, 14:40

    TypoScriptTemplateObjectBrowserModuleFunctionController.php:419

    use "use" statement

    TypoScriptTemplateObjectBrowserModuleFunctionController.php:421

    We should use the error code to be able to translate the message
  17. Helmut Hummel commented on patch set 6 11/03/15, 14:42

    TypoScriptTemplateObjectBrowserModuleFunctionController.php:421 Reply

    yes, fine with me. I only cleaned up the architecture of the fix (removing dependencies to config and classes). But it would of course be nice to have a translated message here (like the other messages emitted by this class)
  18. Daniel Goerz commented on patch set 6 CR -1 11/03/15, 20:40

    on it
  19. Daniel Goerz uploaded patch set 7 11/03/15, 20:42

  20. Daniel Goerz voted on patch set 7 CR +1 V +1 11/03/15, 20:42

  21. Stefan Neufeind voted on patch set 7 V +2 CR +2 11/03/15, 21:31

  22. Stefan Neufeind merged patch set 7 11/03/15, 21:31