Review main Merged

78021[BUGFIX] Fix page reloading on click on preview button (again)

Christian Eßl CR +2 V +2 Easy +11 −4 updated 04/11/23, 18:11

Commit message

The changes introduced in #93706 broke the preview button functionality
in multidomain setups. When first previewing the page in one page tree
and then clicking the preview link in the page tree of a different
domain, a DOMException due to a cross origin error would be triggered
in JavaScript, because it is not allowed to access the constructor of
a window object from a different context.

The thrown DOMException is now properly caught.

Review

  • Code review CR +2 Done
    • Andreas Kienast +2
    • Markus Klein +1
    • Anja Leichsenring +1
    • Tymoteusz Motylewski +1
  • Verified V +2 Done
    • Andreas Kienast +2
    • Markus Klein +1
    • Anja Leichsenring +1
    • Tymoteusz Motylewski +1
    • core-ci +1 CI

Issues 2

Files 2

Review log 1923

  1. Christian Eßl uploaded patch set 1 03/04/23, 09:51

  2. Christian Eßl commented on patch set 1 03/04/23, 09:59

    Easiest way to test this: Just set up the styleguide as described in https://docs.typo3.org/m/typo3/guide-contributionworkflow/main/en-us/Setup/UseStyleguide.html. - Then click a preview link in the first page tree (with domain localhost) and keep the tab open - Now click a preview link in the second page tree
  3. core-ci voted on patch set 1 V +1 03/04/23, 10:26 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38427

  4. Markus Klein commented on patch set 1 CR +1 03/08/23, 21:13

    Thanks for fixing this. I ran into that multiple times.
  5. Christian Eßl uploaded patch set 2 CR +1 V +1 03/13/23, 10:22

  6. core-ci voted on patch set 2 V +1 03/13/23, 10:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38872

  7. Markus Klein voted on patch set 2 V +1 CR +1 03/13/23, 11:53

  8. Oli Bartsch voted on patch set 2 V +1 03/13/23, 12:14

  9. Andreas Kienast commented on patch set 2 CR -1 04/04/23, 08:14

    window-manager.ts:47

    This looks really fishy. I have to think about this.
  10. Andreas Kienast uploaded patch set 3 CR +1 V +1 04/04/23, 09:00

  11. Andreas Kienast commented on patch set 3 04/04/23, 09:00

    window-manager.ts:47 Reply

    Done
  12. Markus Klein updated the commit message in patch set 4 04/04/23, 09:06

  13. core-ci voted on patch set 3 V +1 04/04/23, 09:08 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/40062

  14. core-ci voted on patch set 4 V +1 04/04/23, 09:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/40063

  15. Tymoteusz Motylewski commented on patch set 4 04/04/23, 11:32

    FYI, together with Wiktor we tried to write aceptance tests to validate the fix, but so far couldnt reproduce it using test (manually the issue is reproducable easily). Probably something is needed in fixture data to reproduce it in test env. Anyway, the basic tests are here: https://review.typo3.org/c/Packages/TYPO3.CMS/+/78443
  16. Tymoteusz Motylewski commented on patch set 4 04/05/23, 14:41

    hmm does this patch fixes the same issue as https://review.typo3.org/c/Packages/TYPO3.CMS/+/78473 or is this a different case?
  17. Andreas Kienast commented on patch set 4 04/05/23, 14:42

    Reply

    No, this is about the "View page" button in the record list.
  18. Tymoteusz Motylewski voted on patch set 4 V +1 CR +1 04/07/23, 20:19

  19. Tymoteusz Motylewski commented on patch set 4 04/07/23, 20:21

    works great. Tested it by: 1) added a new domain in ddev and configured it for a second site 2) clicked "view webpage" in page module for one tree 3) switched to a page in different tree (connected to different domain) 4) clicked "view webpage" for this page before the patch preview was not reloaded and an error in the browser console was shown.
  20. Markus Klein voted on patch set 4 V +1 CR +1 04/07/23, 21:15

  21. Anja Leichsenring voted on patch set 4 V +1 CR +1 04/11/23, 17:12

  22. Andreas Kienast commented on patch set 4 V +2 CR +2 04/11/23, 18:11

    I’ll take care of the backport tomorrow.
  23. Andreas Kienast merged patch set 5 04/11/23, 18:11