New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0013430: Calendar: printing day and week sheet broken in FF #6643

Closed
Gloirin opened this Issue Jun 9, 2018 · 24 comments

Comments

Projects
None yet
1 participant
@Gloirin

Gloirin commented Jun 9, 2018

Reported by nbe-renzel-net on 12 Sep 2017 13:16

Version: 2017.08.3 Community Edition

When trying to print the calendar sheets (not lists) for day and week views, it doesn't work and stays at "Preparing print, pleae wait" forever.

Looking at the debugger console of Iridium, I see:

VM5136:1 Uncaught (in promise) SyntaxError: Unexpected number
at Ext.XTemplate.compileTpl (ext-all.js:13170)
at Object.<anonymous> (ext-all.js:13082)
at Object.each (ext-base.js:7)
at new Ext.XTemplate (ext-all.js:13081)
at index.php?method=Tinebase.getJsFiles&8440e83�:43075
at <anonymous>

debugging it a little further, it's caused by "Ext.XTemplate" and its format replacing feature using regular expressions. The Tine20 packed stylesheets look like this here:

.cal-print-marker{top:0}.cal-daysviewpanel-header{position:relative;border-bottom:1px solid #f0f0f0;z-index:5000}.cal-daysviewpanel-header-inner{position:relative;background:#f9f9f9

matches following regexp in the ExtJS "compileTpl" function: "/{([\w-.#]+)(?::([\w.])(?:((.?)?))?)?(\s?[+-*\]\s?[\d.+-*\()]+)?}/g" and therefore being replaced with:

.cal-print-marker',fm.0(values['top']),'.cal-daysviewpanel-header{position:relative;border-bottom:1px solid #f0f0f0;z-index:5000}.cal-daysviewpanel-header-inner{position:relative;background:#f9f9f9

Object "fm.0" is invalid and therefore generates a JavaScript error.

I have no idea how to fix that properly - I've tried to add the "{ disableFormats: true }" option to the "Ext.XTemplate" call, but that kills the stylesheet for the week view...

Steps to reproduce: 1. go to "Calendar"
2. click "Day"
3. click "Sheet"
4. click "Print" - it will hang
5. Press F5 to reload page
6. go to "Calendar"
7. click "Week"
8. click "Sheet"
9. click "Print" - it will hang

@Gloirin

This comment has been minimized.

Show comment
Hide comment
@Gloirin

Gloirin Jun 11, 2018

Comment posted by cweiss on 18 Sep 2017 07:15

I think this is got fixed in the "2017.08.4 Community Edition" can you please verify it?

Gloirin commented Jun 11, 2018

Comment posted by cweiss on 18 Sep 2017 07:15

I think this is got fixed in the "2017.08.4 Community Edition" can you please verify it?

@Gloirin

This comment has been minimized.

Show comment
Hide comment
@Gloirin

Gloirin Jun 11, 2018

Comment posted by nbe-renzel-net on 18 Sep 2017 09:19

Okay, I've upgraded to 2017.08.4

The situation is as follows:

Using Firefox 55.0.3 (64bit): under each of the day, week and month views it doesn't hang at "Preparing print, please wait..." any more but doesn't do anything either. Meaning: the message appears after clicking the "Print" button and disappears after one/two seconds. Nothing more happens then. No error messages in JavaScript console.

Using Irdium 58.0 (64bit): printing works under every view and every mode (grid, sheet) thumbsup

Using Seamonkey 2.48 (64bit): same behaviour as under Firefox

Gloirin commented Jun 11, 2018

Comment posted by nbe-renzel-net on 18 Sep 2017 09:19

Okay, I've upgraded to 2017.08.4

The situation is as follows:

Using Firefox 55.0.3 (64bit): under each of the day, week and month views it doesn't hang at "Preparing print, please wait..." any more but doesn't do anything either. Meaning: the message appears after clicking the "Print" button and disappears after one/two seconds. Nothing more happens then. No error messages in JavaScript console.

Using Irdium 58.0 (64bit): printing works under every view and every mode (grid, sheet) thumbsup

Using Seamonkey 2.48 (64bit): same behaviour as under Firefox

@Gloirin

This comment has been minimized.

Show comment
Hide comment
@Gloirin

Gloirin Jun 11, 2018

Comment posted by frozn on 18 Sep 2017 15:38

Suggested fix in "/Tinebase/js/Tinebase-9f8ab1c17479c3728541-FAT.debug.js" and the minified version (Tine 2017.08.04):

at line 97:

/******/ // webpack_public_path
/******/ webpack_require.p = "/";

changed into (see "frozn"):

/******/ // webpack_public_path
/******/ webpack_require.p = ""; // frozn

works fine now.

Gloirin commented Jun 11, 2018

Comment posted by frozn on 18 Sep 2017 15:38

Suggested fix in "/Tinebase/js/Tinebase-9f8ab1c17479c3728541-FAT.debug.js" and the minified version (Tine 2017.08.04):

at line 97:

/******/ // webpack_public_path
/******/ webpack_require.p = "/";

changed into (see "frozn"):

/******/ // webpack_public_path
/******/ webpack_require.p = ""; // frozn

works fine now.

@Gloirin

This comment has been minimized.

Show comment
Hide comment
@Gloirin

Gloirin Jun 11, 2018

Comment posted by nbe-renzel-net on 19 Sep 2017 06:43

I've tried:
<code>
cd Tinebase/js
cp -pv Tinebase-9f8ab1c17479c3728541-FAT.js Tinebase-9f8ab1c17479c3728541-FAT.js.bak
cp -pv Tinebase-9f8ab1c17479c3728541-FAT.debug.js Tinebase-9f8ab1c17479c3728541-FAT.js
nano Tinebase-9f8ab1c17479c3728541-FAT.js
</code>
then edited line 98 according to your suggestion:
<code>
sed -n '98p' Tinebase-9f8ab1c17479c3728541-FAT.debug.js
/******/ webpack_require.p = "";
</code>

No change in behaviour unfortunately - maybe I'm doing the patch wrongly?

Gloirin commented Jun 11, 2018

Comment posted by nbe-renzel-net on 19 Sep 2017 06:43

I've tried:
<code>
cd Tinebase/js
cp -pv Tinebase-9f8ab1c17479c3728541-FAT.js Tinebase-9f8ab1c17479c3728541-FAT.js.bak
cp -pv Tinebase-9f8ab1c17479c3728541-FAT.debug.js Tinebase-9f8ab1c17479c3728541-FAT.js
nano Tinebase-9f8ab1c17479c3728541-FAT.js
</code>
then edited line 98 according to your suggestion:
<code>
sed -n '98p' Tinebase-9f8ab1c17479c3728541-FAT.debug.js
/******/ webpack_require.p = "";
</code>

No change in behaviour unfortunately - maybe I'm doing the patch wrongly?

@Gloirin

This comment has been minimized.

Show comment
Hide comment
@Gloirin

Gloirin Jun 11, 2018

Comment posted by frozn on 19 Sep 2017 07:40

did you empty the browser cache?

Gloirin commented Jun 11, 2018

Comment posted by frozn on 19 Sep 2017 07:40

did you empty the browser cache?

@Gloirin

This comment has been minimized.

Show comment
Hide comment
@Gloirin

Gloirin Jun 11, 2018

Comment posted by frozn on 19 Sep 2017 07:43

or: you copy "Tinebase-9f8ab1c17479c3728541-FAT.debug.js" to "Tinebase-9f8ab1c17479c3728541-FAT.js" but edited the "Tinebase-9f8ab1c17479c3728541-FAT.debug.js" afterwards? if so, then the edited line isn't in "Tinebase-9f8ab1c17479c3728541-FAT.js".

Gloirin commented Jun 11, 2018

Comment posted by frozn on 19 Sep 2017 07:43

or: you copy "Tinebase-9f8ab1c17479c3728541-FAT.debug.js" to "Tinebase-9f8ab1c17479c3728541-FAT.js" but edited the "Tinebase-9f8ab1c17479c3728541-FAT.debug.js" afterwards? if so, then the edited line isn't in "Tinebase-9f8ab1c17479c3728541-FAT.js".

@Gloirin

This comment has been minimized.

Show comment
Hide comment
@Gloirin

Gloirin Jun 11, 2018

Comment posted by nbe-renzel-net on 19 Sep 2017 07:45

Yep, and additionally pressed CTRL + F5 to forcibly reload all files. Using the debugger, I can confirm that it uses the modified JS file...

Gloirin commented Jun 11, 2018

Comment posted by nbe-renzel-net on 19 Sep 2017 07:45

Yep, and additionally pressed CTRL + F5 to forcibly reload all files. Using the debugger, I can confirm that it uses the modified JS file...

@Gloirin

This comment has been minimized.

Show comment
Hide comment
@Gloirin

Gloirin Jun 11, 2018

Comment posted by nbe-renzel-net on 19 Sep 2017 07:51

Yeah, sorry; the SED line I've posted was brainfuck - I really have edited the correct file as well:
''
#diff Tinebase-9f8ab1c17479c3728541-FAT.debug.js Tinebase-9f8ab1c17479c3728541-FAT.js^M
#sed -n '98p' Tinebase-9f8ab1c17479c3728541-FAT.debug.js^M
/******/ webpack_require.p = "";
#sed -n '98p' Tinebase-9f8ab1c17479c3728541-FAT.js^M
/******/ webpack_require.p = "";
''

Gloirin commented Jun 11, 2018

Comment posted by nbe-renzel-net on 19 Sep 2017 07:51

Yeah, sorry; the SED line I've posted was brainfuck - I really have edited the correct file as well:
''
#diff Tinebase-9f8ab1c17479c3728541-FAT.debug.js Tinebase-9f8ab1c17479c3728541-FAT.js^M
#sed -n '98p' Tinebase-9f8ab1c17479c3728541-FAT.debug.js^M
/******/ webpack_require.p = "";
#sed -n '98p' Tinebase-9f8ab1c17479c3728541-FAT.js^M
/******/ webpack_require.p = "";
''

@Gloirin

This comment has been minimized.

Show comment
Hide comment
@Gloirin

Gloirin Jun 11, 2018

Comment posted by frozn on 19 Sep 2017 07:59

hm, i switched back and forth between the original and my changed file. if my changes are in effect, printing the day/week as a sheet works nice, if not printing fails like you described in the bug report. i tested it in chrome 61.0.3163.91.

Gloirin commented Jun 11, 2018

Comment posted by frozn on 19 Sep 2017 07:59

hm, i switched back and forth between the original and my changed file. if my changes are in effect, printing the day/week as a sheet works nice, if not printing fails like you described in the bug report. i tested it in chrome 61.0.3163.91.

@Gloirin

This comment has been minimized.

Show comment
Hide comment
@Gloirin

Gloirin Jun 11, 2018

Comment posted by frozn on 19 Sep 2017 08:03

your change looks right. then i don't have any clue why it doesn't work with you. :-(

Gloirin commented Jun 11, 2018

Comment posted by frozn on 19 Sep 2017 08:03

your change looks right. then i don't have any clue why it doesn't work with you. :-(

@Gloirin

This comment has been minimized.

Show comment
Hide comment
@Gloirin

Gloirin Jun 11, 2018

Comment posted by nbe-renzel-net on 19 Sep 2017 08:03

With "Iridium 58.0" which is Chrome/Chromium-based, I don't have problems either. Please try Firefox 55.0.3 if you have time and wish...

Gloirin commented Jun 11, 2018

Comment posted by nbe-renzel-net on 19 Sep 2017 08:03

With "Iridium 58.0" which is Chrome/Chromium-based, I don't have problems either. Please try Firefox 55.0.3 if you have time and wish...

@Gloirin

This comment has been minimized.

Show comment
Hide comment
@Gloirin

Gloirin Jun 11, 2018

Comment posted by frozn on 19 Sep 2017 08:10

tested it in firefox 55.0.3 (portable): with my changes, the loading box correctly disappears and didn't stay there, but the print dialog didn't open. there are so far no errors in the console. oO

Gloirin commented Jun 11, 2018

Comment posted by frozn on 19 Sep 2017 08:10

tested it in firefox 55.0.3 (portable): with my changes, the loading box correctly disappears and didn't stay there, but the print dialog didn't open. there are so far no errors in the console. oO

@Gloirin

This comment has been minimized.

Show comment
Hide comment
@Gloirin

Gloirin Jun 11, 2018

Comment posted by nbe-renzel-net on 21 Sep 2017 11:48

well, anything else I can try (apart from installing Chrome/Chromium/Iridium on every employee's computer)?

Gloirin commented Jun 11, 2018

Comment posted by nbe-renzel-net on 21 Sep 2017 11:48

well, anything else I can try (apart from installing Chrome/Chromium/Iridium on every employee's computer)?

@Gloirin

This comment has been minimized.

Show comment
Hide comment
@Gloirin

Gloirin Jun 11, 2018

Comment posted by cweiss on 5 Oct 2017 11:30

guys, i have no idea what you are trying. this is my fix

  •                win.document.execCommand(&#039;print&#039;, false, null);
    
  •                if (!win.document.execCommand(&#039;print&#039;, false, null)) {
    
  •                    win.print();
    
  •                }
    

Gloirin commented Jun 11, 2018

Comment posted by cweiss on 5 Oct 2017 11:30

guys, i have no idea what you are trying. this is my fix

  •                win.document.execCommand(&#039;print&#039;, false, null);
    
  •                if (!win.document.execCommand(&#039;print&#039;, false, null)) {
    
  •                    win.print();
    
  •                }
    
@Gloirin

This comment has been minimized.

Show comment
Hide comment
@Gloirin

Gloirin Jun 11, 2018

Comment posted by cweiss on 5 Oct 2017 11:31

http://gerrit.tine20.com/customers/5923

Gloirin commented Jun 11, 2018

Comment posted by cweiss on 5 Oct 2017 11:31

http://gerrit.tine20.com/customers/5923

@Gloirin

This comment has been minimized.

Show comment
Hide comment
@Gloirin

Gloirin Jun 11, 2018

Comment posted by cweiss on 5 Oct 2017 20:10

quote frozn (per mail), installation from subdir:

my suggested fix is still necessary. without my fix the following resource couldn't be loaded if printing a day as a sheet:

400 GET http://<server>/Tinebase/js/html2canvas-b8a97f52c29fda54576c-FAT.js

the loading box didn't disappear and the print dialog didn't open, too. with my and your fix, all works fine, also in firefox:

200 GET http://<server>/tine/Tinebase/js/html2canvas-b8a97f52c29fda54576c-FAT.js

@frozn: and this is FF only? - this would mean we have a problem with webpack itself

Gloirin commented Jun 11, 2018

Comment posted by cweiss on 5 Oct 2017 20:10

quote frozn (per mail), installation from subdir:

my suggested fix is still necessary. without my fix the following resource couldn't be loaded if printing a day as a sheet:

400 GET http://<server>/Tinebase/js/html2canvas-b8a97f52c29fda54576c-FAT.js

the loading box didn't disappear and the print dialog didn't open, too. with my and your fix, all works fine, also in firefox:

200 GET http://<server>/tine/Tinebase/js/html2canvas-b8a97f52c29fda54576c-FAT.js

@frozn: and this is FF only? - this would mean we have a problem with webpack itself

@Gloirin

This comment has been minimized.

Show comment
Hide comment
@Gloirin

Gloirin Jun 11, 2018

Comment posted by frozn on 6 Oct 2017 20:20

no, this problem exists in chrome, too.

All occurrences of "webpack_require.p" (webpack public path) in "Tinebase-9f8ab1c17479c3728541-FAT-debug.js" are assigned with "" except the place I have mentioned. there it is assigned with "/", which seems to be wrong.

Gloirin commented Jun 11, 2018

Comment posted by frozn on 6 Oct 2017 20:20

no, this problem exists in chrome, too.

All occurrences of "webpack_require.p" (webpack public path) in "Tinebase-9f8ab1c17479c3728541-FAT-debug.js" are assigned with "" except the place I have mentioned. there it is assigned with "/", which seems to be wrong.

@Gloirin

This comment has been minimized.

Show comment
Hide comment
@Gloirin

Gloirin Jun 11, 2018

Comment posted by cweiss on 12 Oct 2017 18:11

I can't reproduce this. also if I don't install in the docroot.

@frozn: which installation type do you have? is it a deb/rpm installation with default web server setup (/tine20 as alias) or a source package installed in the tine20 subdir of the docroot?

Gloirin commented Jun 11, 2018

Comment posted by cweiss on 12 Oct 2017 18:11

I can't reproduce this. also if I don't install in the docroot.

@frozn: which installation type do you have? is it a deb/rpm installation with default web server setup (/tine20 as alias) or a source package installed in the tine20 subdir of the docroot?

@Gloirin

This comment has been minimized.

Show comment
Hide comment
@Gloirin

Gloirin Jun 11, 2018

Comment posted by nbe-renzel-net on 13 Oct 2017 06:52

> guys, i have no idea what you are trying. this is my fix
> - win.document.execCommand('print', false, null);
> + if (!win.document.execCommand('print', false, null)) {
> + win.print();
> + }

confirmed - with this modification and running on 2017.08.6 the "Print Page" button works in Firefox now...

Gloirin commented Jun 11, 2018

Comment posted by nbe-renzel-net on 13 Oct 2017 06:52

> guys, i have no idea what you are trying. this is my fix
> - win.document.execCommand('print', false, null);
> + if (!win.document.execCommand('print', false, null)) {
> + win.print();
> + }

confirmed - with this modification and running on 2017.08.6 the "Print Page" button works in Firefox now...

@Gloirin

This comment has been minimized.

Show comment
Hide comment
@Gloirin

Gloirin Jun 11, 2018

Comment posted by cweiss on 13 Oct 2017 14:01

@nbe-renzel-net do you have your installation in the docroot (tine.example.com/) or in a subdir (example.com/tine20/)?

Gloirin commented Jun 11, 2018

Comment posted by cweiss on 13 Oct 2017 14:01

@nbe-renzel-net do you have your installation in the docroot (tine.example.com/) or in a subdir (example.com/tine20/)?

@Gloirin

This comment has been minimized.

Show comment
Hide comment
@Gloirin

Gloirin Jun 11, 2018

Comment posted by nbe-renzel-net on 13 Oct 2017 14:16

DocRoot - it's an own vHost for Tine20...

Gloirin commented Jun 11, 2018

Comment posted by nbe-renzel-net on 13 Oct 2017 14:16

DocRoot - it's an own vHost for Tine20...

@Gloirin

This comment has been minimized.

Show comment
Hide comment
@Gloirin

Gloirin Jun 11, 2018

Comment posted by frozn on 13 Oct 2017 16:23

it's a standard installation of apache 2.4.28 under windows 10 with php 7.1.7 as a module. it runs as a service. in "httpd.conf" I only added the suggested rewrite rule for active sync. in my htdocs folder i created the subfolder "tine" and extracted the content of "tine20-allinone_2017.08.6.zip" into it. a few days ago I did a fresh installation, and tested It again today with same result: with webpack_require.p = "" it works fine, with webpack_require.p = "/" there is the 400 for "http://<server>/Tinebase/js/html2canvas-b8a97f52c29fda54576c-FAT.js".

my steps to reproduce:

  • switch to calendar
  • switch to day/sheet
  • push little arrow right of "print page" and select "sheet".

rewrite rule:
RewriteEngine On
RewriteRule Microsoft-Server-ActiveSync(.*) /tine/index.php?frontend=activesync [E=REMOTE_USER:%{HTTP:Authorization},L,QSA]

Gloirin commented Jun 11, 2018

Comment posted by frozn on 13 Oct 2017 16:23

it's a standard installation of apache 2.4.28 under windows 10 with php 7.1.7 as a module. it runs as a service. in "httpd.conf" I only added the suggested rewrite rule for active sync. in my htdocs folder i created the subfolder "tine" and extracted the content of "tine20-allinone_2017.08.6.zip" into it. a few days ago I did a fresh installation, and tested It again today with same result: with webpack_require.p = "" it works fine, with webpack_require.p = "/" there is the 400 for "http://<server>/Tinebase/js/html2canvas-b8a97f52c29fda54576c-FAT.js".

my steps to reproduce:

  • switch to calendar
  • switch to day/sheet
  • push little arrow right of "print page" and select "sheet".

rewrite rule:
RewriteEngine On
RewriteRule Microsoft-Server-ActiveSync(.*) /tine/index.php?frontend=activesync [E=REMOTE_USER:%{HTTP:Authorization},L,QSA]

@Gloirin

This comment has been minimized.

Show comment
Hide comment
@Gloirin

Gloirin Jun 11, 2018

Comment posted by cweiss on 12 Jan 2018 08:49

this problem is strange - i still can't reproduce it.

if somebody has a build setup in place, please try to remove line 57 from Tinebase/js/webpack.common.js
publicPath: '/',
do the build and see if it resolves the problem.

Next release (2017.08.11) we'll also build with this setting. please try if it helps

Gloirin commented Jun 11, 2018

Comment posted by cweiss on 12 Jan 2018 08:49

this problem is strange - i still can't reproduce it.

if somebody has a build setup in place, please try to remove line 57 from Tinebase/js/webpack.common.js
publicPath: '/',
do the build and see if it resolves the problem.

Next release (2017.08.11) we'll also build with this setting. please try if it helps

@Gloirin

This comment has been minimized.

Show comment
Hide comment
@Gloirin

Gloirin Jun 11, 2018

Comment posted by cweiss on 12 Jan 2018 08:50

I set it to resolved in 2017.08.11. let's see if it helps. Please reopen if not.

Gloirin commented Jun 11, 2018

Comment posted by cweiss on 12 Jan 2018 08:50

I set it to resolved in 2017.08.11. let's see if it helps. Please reopen if not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment