55820[BUGFIX] Let form framework finisher parseOption respect arrays
Commit message
Review
-
Code review CR +2
- Frank Nägler +2
- Stefan Froemken +1
-
Verified V +2
- Frank Nägler +2
- Stefan Froemken +1
- TYPO3com +1 CI
Issues 2
Files 2
Review log 4872
Show 3047 earlier messages
-
Ralf Zimmermann uploaded patch set 1 02/20/18, 09:19
-
Ralf Zimmermann uploaded patch set 2 02/20/18, 09:23
-
TYPO3com voted on patch set 1 V +1 02/20/18, 09:28 Completed build in 08m 07s on Tue, 20 Feb, 10:28 AM Test Summary: 30902 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-19889
-
TYPO3com voted on patch set 2 V +1 02/20/18, 09:32 Completed build in 08m 51s on Tue, 20 Feb, 10:32 AM Test Summary: 30902 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-19890
-
Björn Jacob updated the commit message in patch set 3 02/20/18, 17:22
-
TYPO3com voted on patch set 3 V +1 02/20/18, 17:36 Completed build in 14m 06s on Tue, 20 Feb, 06:36 PM Test Summary: 30902 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-19933
-
Oliver Hader updated the commit message in patch set 4 02/20/18, 18:06
-
TYPO3com voted on patch set 4 V +1 02/20/18, 18:17 Completed build in 10m 49s on Tue, 20 Feb, 07:17 PM Test Summary: 30902 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-19938
-
Oliver Hader commented on patch set 4 CR -1 02/21/18, 10:26
Given the following: * options property is an array, e.g. [ '{multicheckbox-1}', 'some static value' ] * multicheckbox-1 has two selected options [ 'aa', 'bb' ] Then the preg_replace_callback invocation would result in: * [ 'aa', 'bb'] since it replaces $optionValue by reference on the first option item '{multicheckbox-1}' However, I guess that the expected output then should be: [ ['aa','bb'], 'some static value' ] Besides that, adjusting $optionValue by reference feels hacky and should be avoided.AbstractFinisher.php:210Now this overrides all options and I'm not sure whether this is the expected behavior, since the callback is executed for each item in case $optionValue is an array. -
Oliver Hader commented on patch set 4 02/21/18, 10:27
-
Oliver Hader commented on patch set 4 02/21/18, 10:30
AbstractFinisher.php:210ReplyI think, it still should `return $value;` here as well - using &$optionValue could be omitted then -
Ralf Zimmermann commented on patch set 4 02/21/18, 10:36
AbstractFinisher.php:210Replyif preg_replace_callback got $optionValue = '{some-identifier}', and the formRuntime value for '{some-identifier}' is an array, than preg_replace_callback returns "Array" as a string if i use the "return $value" statement. preg_replace_callback returns an array if the input is an array. preg_replace_callback can't handle the case, if the input is a string and the output is an array. This is why i use the reference value. -
Ralf Zimmermann commented on patch set 4 CR -1 02/21/18, 11:00
on it -
Ralf Zimmermann uploaded patch set 5 02/21/18, 12:19
-
TYPO3com voted on patch set 5 V -1 02/21/18, 12:19 Completed build in 10s on Wed, 21 Feb, 01:19 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-19970
-
Ralf Zimmermann uploaded patch set 6 02/21/18, 12:21
-
TYPO3com voted on patch set 6 V -1 02/21/18, 12:28 Completed build in 07m 28s on Wed, 21 Feb, 01:28 PM Test Summary: 2 of 31063 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-19971
-
TYPO3com voted on patch set 6 V +1 02/21/18, 13:29 Completed build in 1h 15m 39s on Wed, 21 Feb, 02:29 PM Test Summary: 30911 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-19971
-
Ralf Zimmermann commented on patch set 7 02/21/18, 13:33
Published edit on patch set 6. -
TYPO3com voted on patch set 7 V +1 02/21/18, 13:42 Completed build in 08m 38s on Wed, 21 Feb, 02:42 PM Test Summary: 30911 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-19972
-
Oliver Hader uploaded patch set 8 02/21/18, 15:25
-
TYPO3com voted on patch set 8 V -1 02/21/18, 15:26 Completed build in 09s on Wed, 21 Feb, 04:26 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-19981
-
Oliver Hader commented on patch set 7 02/21/18, 15:26
AbstractFinisher.php:192Shouldn't this be $optionName . $key? -
Oliver Hader commented on patch set 7 02/21/18, 15:28
I've refactored the code a bit and allowed to recursively resolve translations for the resolved values (either from form runtime data or the initial finisher options in case any of those had a nested structure). -
Oliver Hader uploaded patch set 9 02/21/18, 15:28
-
Oliver Hader commented on patch set 9 02/21/18, 15:33
AbstractFinisher.php:306There's one thing that just came to my mind: In case $needle is a string having "{field-1},{field-2}" - this now would override the return value with the last match being processed, thus only the resolved value for "{field-2}" -
TYPO3com voted on patch set 9 V +1 02/21/18, 15:36 Completed build in 08m 01s on Wed, 21 Feb, 04:36 PM Test Summary: 30911 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-19982
-
Ralf Zimmermann commented on patch set 9 02/21/18, 17:35
on it -
Ralf Zimmermann uploaded patch set 10 02/21/18, 17:42
-
TYPO3com voted on patch set 10 V -1 02/21/18, 17:42 Completed build in 09s on Wed, 21 Feb, 06:42 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-19987
-
Ralf Zimmermann commented on patch set 10 02/21/18, 17:51
AbstractFinisher.php:192ReplyNo. This variable is used to build the translation key. If $optionName = 'someOptionName' and $value = 'someOptionValue', the translation service will look for a tranlation key like "some-form-identifier.finisher.Foo.someOptionName.someOptionValue". -
Ralf Zimmermann uploaded patch set 11 02/21/18, 17:52
-
TYPO3com voted on patch set 11 V +1 02/21/18, 18:00 Completed build in 07m 50s on Wed, 21 Feb, 07:00 PM Test Summary: 30914 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-19990
-
Oliver Hader uploaded patch set 12 02/21/18, 19:19
-
Oliver Hader commented on patch set 12 02/21/18, 19:23
AbstractFinisher.php:227@Ralf: I've changed that back to use $value (instead of $key) as you explainedAbstractFinisher.php:279That's the only part where array from FormRuntime are returned - in case only the variable is usedAbstractFinisher.php:301This triggers the regular replacement on each finding - as it has been prior to this patch for regular plain string valuesAbstractFinisher.php:309For having an option like "BEFORE,{multicheckbox-1},AFTER" it cannot be substituted - that's why an exception is thrown now. That's catching the case of having "BEFORE,Array,AFTER" when converted from array to string -
Oliver Hader uploaded patch set 13 02/21/18, 19:25
-
TYPO3com voted on patch set 12 V +1 02/21/18, 19:27 Completed build in 07m 40s on Wed, 21 Feb, 08:27 PM Test Summary: 30917 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-19995
-
TYPO3com voted on patch set 13 V +1 02/21/18, 19:34 Completed build in 08m 41s on Wed, 21 Feb, 08:34 PM Test Summary: 30917 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-19996
-
Oliver Hader voted on patch set 13 V +1 CR +1 02/22/18, 20:56
-
Ralf Zimmermann voted on patch set 13 V +1 CR +1 02/22/18, 20:57
-
Ralf Zimmermann uploaded patch set 14 02/23/18, 09:07
-
TYPO3com voted on patch set 14 V +1 02/23/18, 09:15 Completed build in 08m 26s on Fri, 23 Feb, 10:15 AM Test Summary: 30896 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-20051
-
Ralf Zimmermann uploaded patch set 15 03/15/18, 21:13
-
TYPO3com voted on patch set 15 V +1 03/15/18, 21:24 Completed build in 10m 44s on Thu, 15 Mar, 10:24 PM Test Summary: 30894 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-21155
-
Ralf Zimmermann uploaded patch set 16 03/18/18, 01:00
-
TYPO3com voted on patch set 16 V -1 03/18/18, 01:09 Completed build in 08m 56s on Sun, 18 Mar, 02:09 AM Test Summary: 3 of 31049 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-21589
-
Ralf Zimmermann uploaded patch set 17 03/18/18, 01:15
-
TYPO3com voted on patch set 17 V +1 03/18/18, 01:24 Completed build in 09m 09s on Sun, 18 Mar, 02:24 AM Test Summary: 30897 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-21591
-
Stefan Froemken commented on patch set 17 V -1 04/17/18, 10:57
I get following error with my FlashMessageFinisher and severity = 1: Oops, an error occurred! Argument 4 passed to TYPO3\CMS\Form\Service\TranslationService::translateFinisherOption() must be of the type string, integer given, called in /Users/stefan/htdocs/typo3_src/typo3/sysext/form/Classes/Domain/Finishers/AbstractFinisher.php on line 244 -
Ralf Zimmermann commented on patch set 17 04/17/18, 13:06
on it -
Ralf Zimmermann uploaded patch set 18 04/17/18, 13:23
-
TYPO3com voted on patch set 18 V +1 04/17/18, 13:34 Completed build in 10m 01s on Tue, 17 Apr, 03:34 PM Test Summary: 30965 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-22469
-
Stefan Froemken commented on patch set 18 V -1 04/17/18, 13:35
Hi Ralf. Please do not convert INT values to STRING. 1 is not "1" and this will break FlashMessageFinishers: Oops, an error occurred! Argument 1 passed to TYPO3\CMS\Core\Messaging\AbstractMessage::setSeverity() must be of the type integer, string given, called in /Users/stefan/htdocs/typo3_src/typo3/sysext/core/Classes/Messaging/FlashMessage.php on line 42 -
Oliver Hader commented on patch set 18 04/17/18, 14:22
@StefanFroemken: Can you please add a stack-trace of the misbehavior you're referring to? Thanks in advance -
Stefan Froemken commented on patch set 18 04/17/18, 15:41
https://forge.typo3.org/issues/84698 Yaml-Parser interpretes severity as int correctly. In AbstractFinisher you convert optionValue to string while calling translateFinisherOption(). I don't know why you want to translate an int value?!?! That's why I prefer to early return int values before calling the translation thing. translateFinisherOption will return string or array types only. So, at that point our severity is of type string now. The switch-case in FlashMessageFinisher works, too. But than you create a new object of type FlashMessage. Within its contructor you are calling setSeverity() which is defined as: setSeverity(int $severity = self::OK). Do you see the problem. $severity has to be of type int -
Ralf Zimmermann uploaded patch set 19 04/17/18, 20:27
-
Ralf Zimmermann voted on patch set 19 CR -1 04/17/18, 20:28
-
Ralf Zimmermann uploaded patch set 20 04/17/18, 20:28
-
TYPO3com voted on patch set 19 V +1 04/17/18, 20:36 Completed build in 09m 19s on Tue, 17 Apr, 10:36 PM Test Summary: 31001 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-22501
-
TYPO3com voted on patch set 20 V +1 04/17/18, 20:39 Completed build in 10m 45s on Tue, 17 Apr, 10:39 PM Test Summary: 31001 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-22502
-
Mathias Schreiber voted on patch set 20 V +1 CR +1 04/17/18, 21:27
-
Kay Strobach commented on patch set 20 CR +1 04/17/18, 21:34
looks good imho -
Stefan Froemken commented on patch set 20 CR -1 04/18/18, 05:52
AbstractFinisher.php:186Either isset or ?? but not both -
Ralf Zimmermann commented on patch set 20 04/18/18, 07:14
> Patch Set 20: Code-Review-1 > > (1 comment) This prevents "Undefined index: translation" PHP notices. -
Ralf Zimmermann rebased onto patch set 21 04/18/18, 07:18
-
TYPO3com voted on patch set 21 V -1 04/18/18, 07:19 Completed build in 46s on Wed, 18 Apr, 09:19 AM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-22517
-
Ralf Zimmermann uploaded patch set 22 04/18/18, 07:20
-
TYPO3com voted on patch set 22 V -1 04/18/18, 07:34 Completed build in 14m 08s on Wed, 18 Apr, 09:34 AM Test Summary: 2 of 30871 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-22518
-
TYPO3com voted on patch set 22 V +1 04/18/18, 09:06 Completed build in 2h 00m 30s on Wed, 18 Apr, 11:06 AM Test Summary: 31001 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-22518
-
Stefan Froemken voted on patch set 22 V +1 CR +1 04/18/18, 10:31
-
Frank Nägler voted on patch set 22 V +2 CR +2 04/18/18, 12:21
-
Frank Nägler merged patch set 23 04/18/18, 12:21