Review main Merged

60331[BUGFIX] Enable preview of hidden page translations

Daniel Goerz CR +2 V +2 Easy +17 −5 updated 04/03/19, 11:20

Commit message

TSFE->determineIdIsHiddenPage() now takes the current site language into
account when fetching the page record. When rendering a page translation
the mehtod does no longer reflect the hidden status of the default
language but the status of the translated page instead.

This enables previewing a hidden page translation even if the language
parent is active.

Review

  • Code review CR +2 Done
    • Daniel Goerz +2
    • Susi Moog +1
    • Benni Mack +1
  • Verified V +2 Done
    • Daniel Goerz +2
    • Susi Moog +1
    • Benni Mack +1
    • TYPO3com +1 CI

Issues 1

Files 1

Review log 2427

Show 2 earlier messages
  1. Daniel Goerz uploaded patch set 1 03/25/19, 14:27

  2. Daniel Goerz updated the commit message in patch set 2 03/25/19, 14:37

  1. TYPO3com voted on patch set 1 V +1 03/25/19, 14:44 Completed build in 17m 10s on Mon, 25 Mar, 03:44 PM Test Summary: 47257 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-32951

  2. TYPO3com voted on patch set 2 V +1 03/25/19, 14:53 Completed build in 15m 52s on Mon, 25 Mar, 03:53 PM Test Summary: 47257 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-32952

  3. Benni Mack voted on patch set 2 V +1 CR +1 03/26/19, 07:22

  4. Susi Moog commented on patch set 2 03/27/19, 08:12

    TypoScriptFrontendController.php:945

    if the page I'm trying to see is a translation (languageID > 0) wouldn't it make more sense to directly query that page first? Basically if that is hidden already I would not need to do the other query at all, as preview flags will be set already. I don't quite get why we are checking the l10n_parent first.
  5. Benni Mack commented on patch set 2 03/27/19, 08:21

    TypoScriptFrontendController.php:945 Reply

    Current behaviour (also within Rootline) is always that the default page has to be non-hidden(+access starttime/endtime). Changing this would be a huge (I'd say breaking) change.
  6. Daniel Goerz commented on patch set 2 03/27/19, 08:23

    For configuration with allowLanguageSynchronization on the fields hidden, starttime and endtime field the language parent has to be checked as well. Basically the idea is, if the default language is hidden, we are in preview mode, if it is not hidden, we check the current language. I guess we can switch the checks around but have to do both nevertheless. At least for starttime and endtime allowLanguageSynchronization is set per default TCA config.
  7. Susi Moog commented on patch set 2 03/27/19, 08:30

    > Patch Set 2: > > For configuration with allowLanguageSynchronization on the fields hidden, starttime and endtime field the language parent has to be checked as well. Basically the idea is, if the default language is hidden, we are in preview mode, if it is not hidden, we check the current language. > > I guess we can switch the checks around but have to do both nevertheless. At least for starttime and endtime allowLanguageSynchronization is set per default TCA config. But allow language synchro really sets the values on the translation record, doesn't it - so why would we need to check the default again?
  8. Daniel Goerz commented on patch set 2 03/27/19, 09:05

    > > Patch Set 2: > > > > For configuration with allowLanguageSynchronization on the fields > hidden, starttime and endtime field the language parent has to be > checked as well. Basically the idea is, if the default language is > hidden, we are in preview mode, if it is not hidden, we check the > current language. > > > > I guess we can switch the checks around but have to do both > nevertheless. At least for starttime and endtime allowLanguageSynchronization > is set per default TCA config. > > But allow language synchro really sets the values on the > translation record, doesn't it - so why would we need to check the > default again? Ah I forgot that the value is actually set in the database for the translated record. When I set up the allowLanguageSynchronization config for my tests I did the TCA changes when the records already existed so that was an error on my site. I withdraw my argument :)
  9. Susi Moog commented on patch set 2 03/27/19, 09:33

    TypoScriptFrontendController.php:945 Reply

    so basically I can only preview a hidden translation as long as the default page is not hidden? Meaning in case I create a new page with translation I'd have to first finish the default language, "publish/unhide" that, before I can even preview the translated one?
  10. Daniel Goerz commented on patch set 2 03/27/19, 09:42

    TypoScriptFrontendController.php:945 Reply

    No, with this code preview mode is active if default language is hidden and translation is not checked in this case. This is also the current behavior. Previews of hidden page translation do work if default language is hidden but it fails with active default language. That's what this patch is for.
  11. Susi Moog commented on patch set 2 03/27/19, 10:31

    > Patch Set 2: > > (1 comment)

    TypoScriptFrontendController.php:945 Reply

    so basically we have the cases hidden def | lang | result 0 | 1 | false (wrong) 1 | 1 | true 1 | 0 | true 0 | 0 | false then I'd still say for this method, checking translation if sys_language_uid > 0 requested would be enough?
  12. Daniel Goerz commented on patch set 2 03/27/19, 10:44

    TypoScriptFrontendController.php:945 Reply

    So you suggest the following for sys_language_uid > 0 hidden def | lang | result 0 | 1 | true (different from current behavior) 1 | 1 | true 1 | 0 | false (different from current behavior) 0 | 0 | false I'd like to hear Bennis oppinion on that.
  13. Susi Moog commented on patch set 2 03/27/19, 10:54

    TypoScriptFrontendController.php:945 Reply

    alternatively: if sys_language_uid > 1 and check already returns true, don't check default, check default only if sys_language_uid > 1 && check == false.
  14. Daniel Goerz commented on patch set 2 03/27/19, 11:06

    TypoScriptFrontendController.php:945 Reply

    That would lead to the same result set as the current state of the patch but switch the order for the check in case we have sys_language_uid > 0. Might save us a query from time to time, so I would be fine with it. Still would like to hear Bennis oppinion, though :)
  15. Benni Mack commented on patch set 2 03/27/19, 11:28

    TypoScriptFrontendController.php:945 Reply

    I'd say this is correct: hidden def | lang | result 0 | 1 | true (different from current behavior) 1 | 1 | true 1 | 0 | false (different from current behavior) 0 | 0 | false We should document that in the commit message.
  16. Daniel Goerz commented on patch set 2 CR -2 03/27/19, 11:37

    TypoScriptFrontendController.php:945 Reply Unresolved

    Alright, will take care
  17. Daniel Goerz uploaded patch set 3 03/27/19, 12:52

  18. Daniel Goerz voted on patch set 3 CR 0 03/27/19, 12:52

  19. TYPO3com voted on patch set 3 V +1 03/27/19, 13:02 Completed build in 09m 51s on Wed, 27 Mar, 02:02 PM Test Summary: 47257 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-32984

  20. Benni Mack voted on patch set 3 V +1 CR +1 03/28/19, 07:04

  21. Frans Saris commented on patch set 3 04/01/19, 17:02

    Can this also be backported to 8.7?
  22. Benni Mack commented on patch set 3 04/02/19, 08:48

    Hey Frans, we've fixed this with a hook in our installation for 8.7 and 9.5 (without site handling), but it's not possible with 9.5+site handling anymore... As this is actually a change of visibility / behavior I'd rather not backport this to 8.7, avoiding possible conflicts in 8 installations.
  23. Susi Moog voted on patch set 3 V +1 CR +1 04/03/19, 05:29

  24. Daniel Goerz voted on patch set 3 V +2 CR +2 04/03/19, 11:20

  25. Daniel Goerz merged patch set 4 04/03/19, 11:20