25249[TASK] Streamline usage of BackendUtility::getPagesTSconfig()
Commit message
Review
-
Code review CR +2
- Benni Mack +2
- Markus Klein +1
-
Verified V +2
- Benni Mack +2
- Markus Klein +1
Issues 1
Files 3
Review log 32
Show 7 earlier messages
-
Mr. Jenkins commented on patch set 1 11/10/13, 13:02
Build Successful https://ci.typo3.org/job/typo3-v4-core-gerrit/11948/ : SUCCESS -
Wouter Wolters voted on patch set 1 CR +1 11/10/13, 13:14
-
Markus Klein uploaded patch set 2 11/29/13, 16:57
-
Markus Klein commented on patch set 2 CR -1 11/29/13, 16:58
Sorry cherry picked wrong patch!! -
Markus Klein uploaded patch set 3 11/29/13, 16:59
-
Markus Klein commented on patch set 3 CR -1 11/29/13, 17:02
BackendUtility.php:1140no need for the else if you return above -
Mr. Jenkins commented on patch set 2 11/29/13, 17:11
Build Successful https://ci.typo3.org/job/typo3-v4-core-gerrit/12391/ : SUCCESS
-
Mr. Jenkins commented on patch set 3 11/29/13, 17:11
Build Successful https://ci.typo3.org/job/typo3-v4-core-gerrit/12392/ : SUCCESS -
Philipp Gampe commented on patch set 3 11/29/13, 17:23
BackendUtility.php:1140Replythat would be another patch -
Markus Klein commented on patch set 3 11/29/13, 23:38
I was wrong with my first comment, see there. But I have some doubts with the other changes.InlineElement.php:1613Hm, I'm not sure about this. The TRUE actually forces to recreate the TSconfig in getPagesTSconfig(). Maybe this was intended here?BackendUtility.php:1140ReplyIndeed, I was looking at the diff between set 1 and 3 (unintentionally) and it shows that this area was touched. So I thought let's change that too. But I now see that this area isn't touched at all.BackendUtility.php:3255Hm, this is actually a speed decrease. The BEgetRootLine is called twice now. Once inside getPageTSconfig and here again.InfoPageTyposcriptConfigController.php:91The empty string enforces to skip the caching in getPageTSconfig. Is this intended? -
Philipp Gampe commented on patch set 3 12/02/13, 16:07
answered the comments Please keep in mind that this is a follow-up to the cache parsed pages TSconfig patch. I discovered those issues while checking all calls to getPagesTSconfig() in core.InlineElement.php:1613ReplyThe cache in getPagesTSconfig was introduced just lately. The second value is checked with is_array() which evaluates to false which makes it use the default rootline which is just the same as used inside the cache. Thus also before the cache patch, this parameter was useless and did not have any effect. I guess this is just the result of copy pasting, because this is wrong in many extensions too.BackendUtility.php:3255ReplyNo, because the return value of BEgetRootLine is cached, therefore this is as fast as a simple getter. However, getPagesTSconfig will parse the TS again if you provide the rootline (the default rootline). Calling the function without a rootline will make it serve the TSconfig from cache which is way faster than the extra function call. Note: Providing a rootline to getPagesTSconfig will make it ignore the cache.InfoPageTyposcriptConfigController.php:91ReplyThe caching was just implemented lately. Before, the empty string just made is_array evaluate to false which means to use the default rootline. You may either pass an array (rootline) or NULL to the second parameter. -
Markus Klein commented on patch set 3 CR 0 12/02/13, 16:30
InlineElement.php:1613Replyfine, if the cached and the generated rootline match. ;-)BackendUtility.php:3255ReplyOk, bust still moving this line, does not change anything. The rootline is either calculated inside of getPagesTSconfig and is then fetched from cache here, or, if the line stays were it was, it will be calculated in this call and will be fetched from cache in getPagesTSconfig.InfoPageTyposcriptConfigController.php:91ReplySame here. If you say that the cached version at this point is fine and no recalculation is necessary the parameter can be changed. -
Philipp Gampe commented on patch set 3 12/02/13, 17:22
InlineElement.php:1613ReplyShould do, because the call to get the rootline match.BackendUtility.php:3255ReplyYes, but now getPagesTSconfig can make use of its internal cache, while I could not know about this fact before. Providing a rootline makes getPagesTSconfig ignore the cache.InfoPageTyposcriptConfigController.php:91ReplyWell, the parameter is about a custom (faked) rootline. Neither an empty string nor NULL are a rootline (in form of an array). Providing the NULL here just makes the function detect, that no rootline is used. Basically, an empty string is the wrong value for the second parameter; it must be either array or NULL. -
Markus Klein commented on patch set 3 CR +1 12/02/13, 18:55
InfoPageTyposcriptConfigController.php:91ReplyYes I know that. That's why I say: Since an empty string was specified formerly and only array|NULL is excepted now, this empty string triggers two things: First the cache of getPagesTSconfig is omitted and second the rootline is required (although the rootline might be cached already in will return quickly hence). Changing the parameter to NULL now, will enable getPagesTSconfig to use the internal cache, but this might be wrong, if the '' was done on purpose to force the skipping of the cache. So, if you know that the cache should be used here, it is obligatory to change the parameter to NULL. But if you don't know whether the cache is outdated at this point in the code and it has to be refreshed (by providing something else than NULL or array), then this must not be changed. But I assume you know what you did, so I give a +1 finally. -
Markus Klein rebased onto patch set 3 01/15/14, 14:36
-
Markus Klein voted on patch set 4 CR +1 01/15/14, 14:37
-
Markus Klein voted on patch set 4 V +1 01/15/14, 14:37
-
Mr. Jenkins commented on patch set 4 01/15/14, 14:59
Build Successful https://ci.typo3.org/job/typo3-v4-core-gerrit/13024/ : SUCCESS -
Benni Mack commented on patch set 4 CR +2 01/15/14, 17:13
any good idea on how to test this? -
Markus Klein commented on patch set 4 01/15/14, 17:32
I fear you've to debug and see if the cache is being used or not. -
Markus Klein commented on patch set 4 V 0 01/15/14, 17:32
Have to remove my v+1, forgot to run the functional tests -
Philipp Gampe commented on patch set 4 01/16/14, 08:46
I cannot really test this. You have to take a look at the API before the cache introduction and how was used. Then you can verify (by reading) the the logic did not change. This is just a cleanup that makes sure that the API is not called with wrong parameters in order to make use of the cache logic (which kicks in only if not extra parameters are given). -
Stefan Neufeind commented on patch set 4 01/16/14, 22:48
BackendUtility.php:3250Might that make a difference here? Is rootLine maybe empty (casted to false?) if $TScID is the root of a site? -
Markus Klein commented on patch set 4 01/16/14, 23:10
BackendUtility.php:3250ReplyIf $TScID is the root page then the rootline is NOT empty, but contains only the root page. -
Stefan Neufeind voted on patch set 4 CR +1 01/16/14, 23:24
-
Philipp Gampe commented on patch set 4 01/18/14, 23:17
BackendUtility.php:3250Replyno the call in getPagesTSconfig() is the same: self::BEgetRootLine($id, '', TRUE) while $id is the value of $TScID The reason why I want to skip passing the rootline here is that the cache will be skipped if a rootline is given. Thus by not passing the rootline, we get the pageTS from the runtime cache. The rootline comes from cache too, therefore it is no problem to call BEgetRootLine in both functions. -
Markus Klein commented on patch set 4 V +1 01/19/14, 12:44
Tests are running fine. I'd opt to merge this now, we'll see until beta5 if we get regressions or not. -
Markus Klein uploaded patch set 5 01/19/14, 13:00
-
Mr. Jenkins commented on patch set 5 01/19/14, 13:14
Build Successful https://ci.typo3.org/job/typo3-v4-core-gerrit/13119/ : SUCCESS -
Markus Klein commented on patch set 5 V +1 CR +1 01/19/14, 13:28
Sorry, I accidentally pushed a new version. -
Benni Mack commented on patch set 5 V +2 CR +2 01/20/14, 19:29
Agreed, let's get it in. Had it running and it worked in my use-cases. -
Benni Mack merged patch set 6 01/20/14, 19:29