Tryton - Issues

 

Issue9293

Title Calendar events are wrongly shown
Priority bug Status resolved
Superseder Nosy List ced, pokoli, reviewbot, roundup-bot, yangoon
Type behavior Components sao
Assigned To ced Keywords review
Reviews 301551002,303501002,301661002
View: 301551002, 303501002, 301661002

Created on 2020-05-03.00:30:16 by pokoli, last changed by roundup-bot.

Files
File name Uploaded Type Edit Remove
Screenshot_2020-05-03 Calendario visitas - Tryton.png pokoli, 2020-05-03.00:30:12 image/png
Messages
New changeset f9a3810ab9c6 by Cédric Krier in branch 'default':
Use last fullcalendar version to support jQuery 3.5
https://hg.tryton.org/tryton-env/rev/f9a3810ab9c6
New changeset ec6df070ea18 by Cédric Krier in branch 'default':
Use last fullcalendar version to support jQuery 3.5
https://hg.tryton.org/sao/rev/ec6df070ea18
review301661002 updated at https://codereview.tryton.org/301661002/#ps291761002
msg58120 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2020-05-19.09:20:26
I think we can live without any backport as the issue will not be present on new instalations. 

If someone finds the bug will realize how to fix (updating to new fullcalendar version) thanks to this issue.
msg58119 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2020-05-19.09:14:40
fullcalendar 3.10.2 supports now jQuery 3.5:https://github.com/fullcalendar/fullcalendar/releases/tag/v3.10.2
Here is review301661002 which set it as minimal version.
I'm wondering if we should backport both patches or nothing (as new installation will get the last versions).
New changeset f7815df2c74a by Cédric Krier in branch 'default':
Restore htmlPrefilter of jQuery < 3.5
https://hg.tryton.org/tryton-env/rev/f7815df2c74a
New changeset ddf3530e83e7 by Cédric Krier in branch 'default':
Restore htmlPrefilter of jQuery < 3.5
https://hg.tryton.org/sao/rev/ddf3530e83e7
msg57820 (view) Author: [hidden] (yangoon) (Tryton translator) Date: 2020-05-03.14:43:18
FWIW jquery version 3.5 fixes two XSS vulnerabilities
https://snyk.io/vuln/npm:jquery

Consequentially review301551002 should be obsolete.
review303501002 updated at https://codereview.tryton.org/303501002/#ps303511002
msg57809 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2020-05-03.12:18:13
Here is review303501002 which I think should be back-ported. We could remove it and put a dependency on a fullcalendar release that include my PR.
msg57808 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2020-05-03.12:11:36
I created https://github.com/fullcalendar/fullcalendar/pull/5391 to fix fullcalendar v3 so we can see if they are going to release it.
Meanwhile I think we should restore the former jQuery.htmlPrefilter like described in https://jquery.com/upgrade-guide/3.5/ even if it reduce the security.
msg57806 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2020-05-03.11:35:03
Indeed it is an explicit change in the behavior of jQuery: https://jquery.com/upgrade-guide/3.5/
So I think we should make sao works in xhtml mode.
msg57805 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2020-05-03.11:28:40
As far as I can see, this is not an incompatibility but bugs in jQuery.
I found this traceback (using non minified fullcalendar):

jQuery.Deferred exception: seg is undefined EventRenderer</EventRenderer.prototype.renderFgSegEls/<@http://localhost:8000/bower_components/fullcalendar/dist/fullcalendar.js:4630:21

I could analyze that the code is doing this:

html = "<a class=\"fc-day-grid-event fc-h-event fc-event fc-start fc-end fc-draggable fc-resizable\" style=\"background-color:lightblue;border-color:lightblue;color:black\"><div class=\"fc-content\"> <span class=\"fc-title\">19</span></div><div class=\"fc-resizer fc-end-resizer\" /></a>"
$(html).length

And it find 2 elements instead of only one.

With those two scripts we can see the different behavior of jQuery between the two versions:

https://jsfiddle.net/h3kvbt0s/
https://jsfiddle.net/krj0pyv4/

So for me, we should not pin the version because we still want bugfixes from jQuery but we should have jQuery fixed.
msg57802 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2020-05-03.10:15:37
I do not see what is wrong?
review301551002 updated at https://codereview.tryton.org/301551002/#ps317341002
msg57800 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2020-05-03.00:30:12
Since the release of jQuery 3.5 (10th April 2020) the calendar events are not correctly rended on sao web interface (see atached screenshot). 

Probably this should be fixed by issue8579 as the new versions remove the jQuery dependency but as this afects the current build I think the best option is to use jQuery versions prior to 3.5.
History
Date User Action Args
2020-05-28 18:15:18roundup-botsetmessages: + msg58346
2020-05-28 18:15:15roundup-botsetstatus: testing -> resolved
messages: + msg58345
2020-05-28 18:14:17cedsetkeyword: - backport
2020-05-19 09:38:01reviewbotsetmessages: + msg58122
2020-05-19 09:20:26pokolisetmessages: + msg58120
2020-05-19 09:14:41cedsetstatus: resolved -> testing
reviews: 301551002,303501002 -> 301551002,303501002,301661002
messages: + msg58119
2020-05-04 10:21:51roundup-botsetmessages: + msg57823
2020-05-04 10:21:47roundup-botsetstatus: testing -> resolved
nosy: + roundup-bot
messages: + msg57822
2020-05-03 14:43:18yangoonsetnosy: + yangoon
messages: + msg57820
2020-05-03 12:35:36reviewbotsetmessages: + msg57811

Showing 10 items. Show all history (warning: this could be VERY long)