View Issue Details

IDProjectCategoryView StatusLast Update
0013430Tine 2.0Calendarpublic2017-10-16 10:24
Reporternbe-renzel-netAssigned Tocweiss 
PrioritynormalSeverityminorReproducibilityalways
Status assignedResolutionfixed 
Product Version2017.08.3 Community Edition 
Target VersionFixed in Version2017.11.1~rc3 Caroline Business Edition 
Summary0013430: Calendar: printing day and week sheet broken in FF
DescriptionWhen 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 Reproduce1. 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
Tagscalendar print day week sheet
mwticket

Relationships

related to 0013548 new Druck-Dialog / -vorschau unter Firefox (56.0), Seamonkey/Mozilla nicht aber unter Google Chrome / Chrome / Iron 

Activities

cweiss

cweiss

2017-09-18 09:15

administrator   ~0020700

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

nbe-renzel-net

2017-09-18 11:19

reporter   ~0020702

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
frozn

frozn

2017-09-18 17:38

reporter   ~0020716

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.
nbe-renzel-net

nbe-renzel-net

2017-09-19 08:43

reporter   ~0020718

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?
frozn

frozn

2017-09-19 09:40

reporter   ~0020720

did you empty the browser cache?
frozn

frozn

2017-09-19 09:43

reporter   ~0020722

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".
nbe-renzel-net

nbe-renzel-net

2017-09-19 09:45

reporter   ~0020724

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

nbe-renzel-net

2017-09-19 09:51

reporter   ~0020726

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 = "";
''

Tine20-modifiedJS.jpg (55,526 bytes)
Tine20-modifiedJS.jpg (55,526 bytes)
frozn

frozn

2017-09-19 09:59

reporter   ~0020728

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.
frozn

frozn

2017-09-19 10:03

reporter   ~0020730

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

nbe-renzel-net

2017-09-19 10:03

reporter   ~0020732

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...
frozn

frozn

2017-09-19 10:10

reporter   ~0020734

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
nbe-renzel-net

nbe-renzel-net

2017-09-21 13:48

reporter   ~0020760

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

cweiss

2017-10-05 13:30

administrator   ~0020880

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();
+ }
cweiss

cweiss

2017-10-05 13:31

administrator   ~0020882

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

cweiss

2017-10-05 22:10

administrator   ~0020884

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
frozn

frozn

2017-10-06 22:20

reporter   ~0020888

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.
cweiss

cweiss

2017-10-12 20:11

administrator   ~0020936

Last edited: 2017-10-12 20:23

View 3 revisions

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?

nbe-renzel-net

nbe-renzel-net

2017-10-13 08:52

reporter   ~0020942

> 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...
cweiss

cweiss

2017-10-13 16:01

administrator   ~0020958

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

nbe-renzel-net

2017-10-13 16:16

reporter   ~0020960

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

frozn

2017-10-13 18:23

reporter   ~0020964

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]

Issue History

Date Modified Username Field Change
2017-09-12 15:16 nbe-renzel-net New Issue
2017-09-12 15:16 nbe-renzel-net Tag Attached: calendar print day week sheet
2017-09-18 09:15 cweiss Assigned To => cweiss
2017-09-18 09:15 cweiss Status new => feedback
2017-09-18 09:15 cweiss Note Added: 0020700
2017-09-18 11:19 nbe-renzel-net Note Added: 0020702
2017-09-18 11:19 nbe-renzel-net Status feedback => assigned
2017-09-18 17:38 frozn Note Added: 0020716
2017-09-19 08:43 nbe-renzel-net Note Added: 0020718
2017-09-19 09:40 frozn Note Added: 0020720
2017-09-19 09:43 frozn Note Added: 0020722
2017-09-19 09:45 nbe-renzel-net Note Added: 0020724
2017-09-19 09:51 nbe-renzel-net File Added: Tine20-modifiedJS.jpg
2017-09-19 09:51 nbe-renzel-net Note Added: 0020726
2017-09-19 09:59 frozn Note Added: 0020728
2017-09-19 10:03 frozn Note Added: 0020730
2017-09-19 10:03 nbe-renzel-net Note Added: 0020732
2017-09-19 10:10 frozn Note Added: 0020734
2017-09-21 13:48 nbe-renzel-net Note Added: 0020760
2017-10-05 13:28 cweiss Summary Calendar: printing day and week sheet broken => Calendar: printing day and week sheet broken in FF
2017-10-05 13:30 cweiss Note Added: 0020880
2017-10-05 13:31 cweiss Status assigned => gerrit
2017-10-05 13:31 cweiss Note Added: 0020882
2017-10-05 13:31 cweiss Status gerrit => resolved
2017-10-05 13:31 cweiss Resolution open => fixed
2017-10-05 13:31 cweiss Fixed in Version => 2017.11.1~rc3 Caroline Business Edition
2017-10-05 22:10 cweiss Status resolved => feedback
2017-10-05 22:10 cweiss Note Added: 0020884
2017-10-06 22:20 frozn Note Added: 0020888
2017-10-12 20:11 cweiss Note Added: 0020936
2017-10-12 20:20 cweiss Note Edited: 0020936 View Revisions
2017-10-12 20:23 cweiss Note Edited: 0020936 View Revisions
2017-10-13 08:52 nbe-renzel-net Note Added: 0020942
2017-10-13 08:52 nbe-renzel-net Status feedback => assigned
2017-10-13 16:01 cweiss Note Added: 0020958
2017-10-13 16:16 nbe-renzel-net Note Added: 0020960
2017-10-13 18:23 frozn Note Added: 0020964
2017-10-16 10:24 pschuele Relationship added related to 0013548