3855[FEATURE] Integrate string replacement to stdWrap
Commit message
Review
-
Code review CR +2
- Jigal van Hemert +2
- Jo Hasenau +1
-
Verified V +2
- Jigal van Hemert +2
- Jo Hasenau +1
Issues 1
Files 2
Review log 34
Show 9 earlier messages
-
Stefan Neufeind commented on patch set 1 V 0 07/31/11, 17:34
Tested against the example given in the forge-issue. Works fine for me. Code is mostly the original patch, only slightly reworked. I'm not sure about: * where should "replacement" go in the stdWrap-order * should we have that hierarchy-level of 10/20/30/... inside replacement? Or maybe leave it out here and allow for a general approach (will send a separate mail to typo3-dev) and have .replacement just handle one single replacement as do the other stdWrap-functions The eval-modifier is stripped. All others are allowed "as is". Would be great if we could this into 4.6 before feature-freeze :-) -
Philipp Gampe commented on patch set 1 07/31/11, 17:34
I would prefer that you didn't submit this this uses a deprecated method ... I prepare a new version -
Stefan Neufeind commented on patch set 2 07/31/11, 17:34
Please have a look at https://review.typo3.org/3922 which implements a generic way for multiple stdWrap-calls with numeric indizes. Imho that's the cleaner way of just implementing it here just for "replacement". If we could agree on solution pointed out in 3922 I'd like to reduce "replacement" to only do a single replacement (what currently is already implemented in a separate, protected function) and use the generic way to handle multiple replacements. See forge-entry for #28601 for details what this means the stdWrap-replacement. I'll be happy to write a unittest and documentation for this change here shortly if we (hopefully soon) can get a decision on 3922. -
Stefan Neufeind uploaded patch set 3 07/31/11, 17:34
-
Stefan Neufeind commented on patch set 3 07/31/11, 17:34
* added "pending documentation" to the Wiki (with remark about the multiple-replacement numeric hierarchy) * added example from forge/documentation as a unittest ** more tests could be added (later), like testing that eval-modifiers to execute php-code are not allowed (are ignored) -
Stefan Neufeind commented on patch set 3 07/31/11, 17:34
I would prefer that you didn't submit this Jo, I'm not sure in which way it is "similar" to the split-function. As tsref (http://wiki.typo3.org/TSref/split) and the code for it explain split behaves in the way that it splits by one character and then handles the first value resulting from the split with the rules under "1.", the second with "2." etc. However here for replacement it's completely independent! The code just iterates through the list of 10./20./30./... and for each does independent replacements (some can even be regex while others are not). It is not (!) like "find string and replace first with this, second with that". So that's why I came up with the general multiple-stdWrap-idea in the other commit which I think offers us more flexibility - and if we agree on something like that it would be duplicated functionality to have this under "replacement" here as well again. After reading the source again I also came across the "ksort()" which only sorts by the strings - so you'd actually get na order of "1., 10., 2." and not the numeric order one would expect. (We could use natsort() for that maybe [not tried] or just do it the numerical way as suggested in the other gerrit-review.) Somebody else please make up your mind about this functionality. Feel free to overrule my vote - but I hope to have given some valid reasons for my thoughts. -
Stefan Neufeind uploaded patch set 4 07/31/11, 17:34
-
Stefan Neufeind commented on patch set 4 07/31/11, 17:34
This commit now handles numeric indexes in the correct order (1/2/10 and not 1/10/2 as before). But I'm still unsure if having the handling of multiple replacements in here makes sense at all. Unit-test adjusted to test the indexes are treated correct (by numeric value using natsort()). Unit-test fails because of an issue with the canBeInterpretedAsInteger()-function (see http://forge.typo3.org/issues/28617). -
Stefan Neufeind uploaded patch set 5 07/31/11, 17:34
-
Stefan Neufeind commented on patch set 5 07/31/11, 17:34
Adjusted testcase again. As discussed with Jigal in http://forge.typo3.org/issues/28617 the value "030." is not valid (used in the testcase). And that's why canBeInterpretedAsInteger() results in FALSE (and must not be changed to accept that numerical value ... separate story). So I adjusted the testcase again (shuffled values, shuffled order) and used ksort again but now explicitly with SORT_NUMERIC. Works. -
Steffen Gebert commented on patch set 2 V 0 07/31/11, 17:34
by team member; Looks good to me, approved Ready to submit. Stefan, would you please add documentation? Than we can submit this one. Thanks! -
Jigal van Hemert commented on patch set 3 07/31/11, 17:34
I would prefer that you didn't submit this Agree with Joey. The part to have multiple replacements should not be in this patch. -
Jigal van Hemert commented on patch set 5 07/31/11, 17:34
Verified; Looks good to me, but someone else must approve -
Philipp Gampe commented on patch set 2 07/31/11, 17:34
Verified; Looks good to me, but someone else must approve I just added the check for proptery. as mentioned by Jo. I also replaced the call to t3lib_div::testInt with t3lib_utility_Math::canBeInterpretedAsInteger. Last but not least, I fixed some whitespace and changed preceeds to precedes. -
Philipp Gampe uploaded patch set 2 07/31/11, 17:34
-
Philipp Gampe commented on patch set 2 07/31/11, 17:34
Fails -
Philipp Gampe commented on patch set 2 07/31/11, 17:34
No score -
Philipp Gampe commented on patch set 2 V 0 07/31/11, 17:34
Now verified. Great feature. -
Philipp Gampe commented on patch set 3 07/31/11, 17:34
Verified; Looks good to me, but someone else must approve Looks good. -
Jo Hasenau commented on patch set 1 07/31/11, 17:34
Fails; I would prefer that you didn't submit this The stdWrap implementation within the replacement sections is done without checking for the stdWrap settings first. $search = $this->stdWrap($configuration['search'], $configuration['search.']); $replace = $this->stdWrap($configuration['replace'], $configuration['replace.']); should be $search = isset($configuration['search.']) ? $this->stdWrap($configuration['search'], $configuration['search.']) : $configuration['search']; $replace = isset($configuration['replace.']) ? $this->stdWrap($configuration['replace'], $configuration['replace.']) : $configuration['replace']; I'm currently in the train so no chance to code or push it. Regarding the numbered sections I think we should let them in as is, since the won't change the original stdWrap chains, which IMHO is a job for another patch, if any ... -
Jo Hasenau commented on patch set 1 07/31/11, 17:34
Verified; Looks good to me, but someone else must approve Basically it does what the description says. We can still fix the "bug" with the missing stdWrap-check later. -
Jo Hasenau commented on patch set 2 07/31/11, 17:34
Verified; Looks good to me, but someone else must approve Cool - you even implemented the missing checks - thumbs up! -
Jo Hasenau commented on patch set 3 07/31/11, 17:34
Fails; I would prefer that you didn't submit this Patchset 2 already contained the way to go, since it implemented a functionality similar to stdWrap.split In this case the numeric keys are not used to separate and order multiple different stdWrap function calls but multiple setups for the same stdWrap function. So regardless of the "we want ordered stdWrap functions sorted by key" approach, this should stay as is and go in like that. -
Jo Hasenau commented on patch set 3 07/31/11, 17:34
Verified; Looks good to me, but someone else must approve Sorry for my former vote, I just missed the numeric key part in the diff. -
Jo Hasenau commented on patch set 3 07/31/11, 17:34
Well - the similarity is that both would use the numeric keys just internally to execute different functions but still in the scope of the original function. So the numeric keys within "replacement" would still do the same, namely replace parts of the original string. If you would try to acchieve that with the "numeric keys for stdWrap" approach it would mean to fire up a fully fledged stdWrap for each and every numeric key instead of handling all the keys within just one stdWrap function call. This is why I would prefer the "internal" solution in this case and for similar cases as well. We can still introduce a property "orderedStdWrap" that doesn't interfere in any way with this "internal" solution, which is why I voted for it. But you are right, that we should change the way of sorting before merging it. -
Jo Hasenau commented on patch set 4 07/31/11, 17:34
Verified; Looks good to me, but someone else must approve -
Jo Hasenau commented on patch set 5 07/31/11, 17:34
Verified; Looks good to me, but someone else must approve -
Mr. Jenkins commented on patch set 1 07/31/11, 17:34
Build Successful http://ci.typo3.org/job/typo3-v4-core-gerrit/1411/ : SUCCESS -
Mr. Jenkins commented on patch set 2 07/31/11, 17:34
Build Successful http://ci.typo3.org/job/typo3-v4-core-gerrit/1441/ : SUCCESS -
Mr. Jenkins commented on patch set 3 07/31/11, 17:34
Build Successful http://ci.typo3.org/job/typo3-v4-core-gerrit/1453/ : SUCCESS -
Mr. Jenkins commented on patch set 4 07/31/11, 17:34
Build Successful http://ci.typo3.org/job/typo3-v4-core-gerrit/1469/ : SUCCESS -
Mr. Jenkins commented on patch set 5 07/31/11, 17:34
Build Successful http://ci.typo3.org/job/typo3-v4-core-gerrit/1473/ : SUCCESS -
Jigal van Hemert commented on patch set 5 V 0 07/31/11, 17:34
by team member; Looks good to me, approved -
Jigal van Hemert merged patch set 5 07/31/11, 17:34