Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-3747

calendar.js contains an error

XMLWordPrintable

      I believe the javascript that is used to add a calendar feature (calendar.js) contains an error:

      Error: too much recursion
      Source File: http://<domainName>/magnoliaAuthor/.resources/calendar/calendar.js
      Line: 1797

      I bumped into this as I added a "custom" calendar to my website using some javascript. At some point in this "custom" calendar I do a call on the setFullYear(Y) function of the Date object. That's where the error comes up (stack overflow).

      It seems that calendar.js (coming from Magnolia own calendar) is redefining this Date.setFullYear(Y) function for some reason! And it does it badly which creates a stack overflow

      This issue only comes up in IE I believe - I tried with IE8 and below and it came up every time. Chrome seem to manage this issue and I believe Firefox too. It would have to be checked though.

      + It looks like the error is fixable, see http://community.zikula.org/module-Forum-viewtopic-topic-57870.htm

      • Replace the following:
        Date.prototype.__msh_oldSetFullYear = Date.prototype.setFullYear;
      • With:
        if( Date.prototype.__msh_oldSetFullYear == null ) { Date.prototype.__msh_oldSetFullYear = Date.prototype.setFullYear; }

        Acceptance criteria

              pbaerfuss Philipp Bärfuss
              adrien_be Adrien Berthou
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Bug DoR
                  Task DoD

                    Estimated:
                    Original Estimate - 1d
                    1d
                    Remaining:
                    Remaining Estimate - 1d
                    1d
                    Logged:
                    Time Spent - Not Specified
                    Not Specified