View Issue Details

IDProjectCategoryView StatusLast Update
0013430Tine 2.0Calendarpublic2017-09-21 13:48
Reporternbe-renzel-netAssigned Tocweiss 
PrioritynormalSeverityminorReproducibilityalways
Status assignedResolutionopen 
Product Version2017.08.3 Community Edition 
Target VersionFixed in Version 
Summary0013430: Calendar: printing day and week sheet broken
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

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

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