Review main Merged

24948[BUGFIX] Blank page in Firefox view module

Eric Chavaillaz CR +2 V +2 Easy +1 −1 updated 11/12/13, 14:38

Commit message

When you click on the view icon of the view module,
a new page is opened to the website. In Firefox,
if you return to the TYPO3 backend in the view mod,
you got a blank page with a [object Window] text.

Review

  • Code review CR +2
    • Stefan Neufeind +2
    • Markus Klein +1
  • Verified V +2
    • Stefan Neufeind +2
    • Markus Klein +1

Issues 1

Files 1

Review log 25

  1. Mr. Jenkins commented on patch set 1 10/22/13, 05:56

  2. Wouter Wolters updated the commit message in patch set 1 11/02/13, 14:05

  3. Wouter Wolters voted on patch set 2 V +1 CR +1 11/02/13, 14:05

  4. Mr. Jenkins commented on patch set 2 11/02/13, 14:24

  5. Stefan Neufeind commented on patch set 2 V +1 CR -1 11/08/13, 14:02

    Works. But imho it's not good that a new window is opened upon every request. Maybe make it behave like the View-button in the Page-module? <a title="View webpage" onclick="var previewWin = window.open('...','newTYPO3frontendWindow');previewWin.focus();" href="#">
  6. Stefan Neufeind commented on patch set 2 11/08/13, 14:02

    Does this only affect 6.2 because of the new view-functionality (changing viewport-size, ...)? Or also previous releases?
  7. Eric Chavaillaz commented on patch set 2 11/09/13, 13:29

    To use the "web_layout" method, we must assign a new variable to the Fluid template... To genreate this button, the "web_layout" module use this line : $viewLink = '<a href="#" onclick="' . htmlspecialchars(BackendUtility::viewOnClick($this->id, $this->backPath, BackendUtility::BEgetRootLine($this->id), '', '', ('&L=' . $lP))) . '">' . IconUtility::getSpriteIcon('actions-document-view') . '</a>'; It's an idea. But why we should not open a new window on every request?

    Reply

    The bug appears also in TYPO3 6.1, in the oldest releases there is no view icon...
  8. Stefan Neufeind commented on patch set 2 11/09/13, 13:34

    Well, it's the behaviour the Page-module currently has. Imho we should have one common behaviour in both places. And afaik it's been like this in the page-module since quite a long time. Personally I like the behaviour in the Page-module (opening in the same window instead of a new one) because if you modify things and preview a page again or preview another page you usually don't want 20 (old) open windows around.
  9. Eric Chavaillaz commented on patch set 2 11/09/13, 13:40

    I agree that the same behaviour must be implemented everywhere. But I am not sure to understand what you said about the page module. In the page module, when you click the icon, a new window is also opened, no? The generated link is like var previewWin = window.open('http://yourwebsite.com/index.php?id=yourid','newTYPO3frontendWindow');previewWin.focus(); But if it is what you recommend, I can update the patch. Let me know it. Thanks
  10. Stefan Neufeind commented on patch set 2 11/09/13, 15:20

    Yes, that code you mentioned is correct. It contains "newTYPO3frontendWindow". So if you click that link again, the window will update. It's a named child-window.
  11. Eric Chavaillaz commented on patch set 2 11/09/13, 16:14

    Ok, now I see what you want ti say. So I am forced to not use a Fluid view helper in the view (button do not support onclick property). I must use a manual html anchor with a onclick property. It's old-school but why not. I will provide another patch who takes care of your remarks.
  12. Stefan Neufeind commented on patch set 2 11/09/13, 16:45

    try additionalAttributes="{onclick: '...'}" in the fluid-tag
  13. Eric Chavaillaz commented on patch set 2 11/10/13, 15:55

    I got a fatal error when I try the additionalAttributes : Argument "additionalAttributes" was not registered. Any other idea? Thanks
  14. Stefan Neufeind uploaded patch set 3 11/11/13, 22:18

  15. Stefan Neufeind commented on patch set 3 11/11/13, 22:23

    @Eric: I checked the source. Yes, additionalAttributes works with the normal (standard-based) ViewHelpers but not with the custom-mode ones only to be used in BE *sigh* So with the current ViewHelpers there is only a "hacky" way (see attached patch). With this onclick-way now you can open the href the usual way (right-click and copy URL, right-click and open-in-new-tab etc.) or click and have it opened in the way like the Page-module behaves. I'll see to maybe get the BE-ViewHelpers improved a bit in a separate patch.
  16. Stefan Neufeind voted on patch set 3 V +1 11/11/13, 22:23

  17. Mr. Jenkins commented on patch set 3 11/11/13, 22:29

  18. Stefan Neufeind commented on patch set 3 11/11/13, 22:52

    Let's see if allowing additionalAttributes finds approval of the colleages. Patch over at https://review.typo3.org/25293
  19. Eric Chavaillaz commented on patch set 3 11/12/13, 06:46

    Ok, it works like this.
  20. Eric Chavaillaz commented on patch set 3 11/12/13, 06:52

    And if this patch (https://review.typo3.org/#/c/25293/) is accepted, we could change your hack with : <f:be.buttons.icon uri="{url}" icon="actions-document-view" additionalAttributes="{onclick: \"var previewWin = window.open(this.href,'newTYPO3frontendWindow');previewWin.focus();return false;\"}" /> It's a little more elegant ;-)
  21. Markus Klein uploaded patch set 4 11/12/13, 14:25

  22. Markus Klein voted on patch set 4 V +1 CR +1 11/12/13, 14:26

  23. Stefan Neufeind voted on patch set 4 V +2 CR +2 11/12/13, 14:36

  24. Stefan Neufeind merged patch set 5 11/12/13, 14:36

  25. Mr. Jenkins commented on patch set 4 11/12/13, 14:38