FullCalendar Macro
  1. FullCalendar Macro
  2. FULLCAL-17

Callback to update events needs to be updated for new version of fullCalendar

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0
    • Labels:
    • Similar issues:

      Description

      The signature of the eventDrop/eventResize callback in Calendar.FullCalendar
      has changed and now causes the "updateEvent" to sends the updated event data erroneously as:

      • deltaDays : is the complete difference in milli-seconds now
      • deltaMinutes : contains garbage (actually the string representation of some function)
        To get this back to work, the format of request parameters in the updateurl
        (for UpdateService service) might need to change, or the code in Macro

      To reproduce try something like:

        {{velocity}}
          {{calendar classname="Blog.BlogPostClass" editable="true" startfield="publishDate"
              updateurl="$xwiki.getURL('Calendar.UpdateService', 'get', 'outputSyntax=plain')" 
             year="2009" month="6" date="1" /}}
        {{/velocity}}
      

      this should show the default blog post and make it "moveable".
      Doing so creates an error because:

         Error number 11007 in 0: Failed to extract Entity Resource from URL [http://localhost:8080/xwiki/bin/get/Calendar/UpdateService?outputSyntax=plain&xpage=plain&outputSyntax=plain&classname=Blog.BlogPostClass&startfield=publishDate&durationfield=duration&page=Blog.BlogIntroduction&isResize=0&dayDelta=86400000&minuteDelta=function%20(){o.undo(),H()}&allDay=1]
      [...]
      Caused by: 
      java.net.URISyntaxException: Illegal character in query at index 265: http://localhost:8080/xwiki/bin/get/Calendar/UpdateService?outputSyntax=plain&xpage=plain&outputSyntax=plain&classname=Blog.BlogPostClass&startfield=publishDate&durationfield=duration&page=Blog.BlogIntroduction&isResize=0&dayDelta=86400000&minuteDelta=function%20(){o.undo(),H()}&allDay=1
      	at java.net.URI$Parser.fail(URI.java:2829)
      	at java.net.URI$Parser.checkChars(URI.java:3002)
      	at java.net.URI$Parser.parseHierarchical(URI.java:3092)
      	at java.net.URI$Parser.parse(URI.java:3034)
      	at java.net.URI.<init>(URI.java:595)
      	at java.net.URL.toURI(URL.java:938)
      	at org.xwiki.url.internal.ExtendedURL.<init>(ExtendedURL.java:79)
      	at org.xwiki.url.internal.standard.StandardResourceFactory.createResource(StandardResourceFactory.java:92)
      	at org.xwiki.url.internal.standard.StandardResourceFactory.createResource(StandardResourceFactory.java:44)
      	at org.xwiki.url.internal.DefaultResourceFactory.createResource(DefaultResourceFactory.java:73)
      	at org.xwiki.url.internal.DefaultResourceFactory.createResource(DefaultResourceFactory.java:44)
      	at com.xpn.xwiki.XWiki.initializeResourceFromURL(XWiki.java:543)
      	at com.xpn.xwiki.XWiki.getXWiki(XWiki.java:496)
      

      obviously minuteDelta is garbage and dayDelta=86400000 is not the full days the event has moved, but millis.

      (Blog posts are only used here to create a quick setup to create the error.
      Even with a fixed update service I do not expect that moving blog posts via the default UpdatService might work, as they do not have a duration field, but that is not the problem here.)

      Docs for the modfied callbacks:
      http://fullcalendar.io/docs/event_ui/eventDrop/
      http://fullcalendar.io/docs/event_ui/eventResize/

      compare with the old version:
      http://fullcalendar.io/docs1/event_ui/eventDrop/
      http://fullcalendar.io/docs1/event_ui/eventResize/

      This only affects the latest 2.0-SNAPSHOT, not any released version.

      See also for a similar code im MoccaCalendar in the fullcal-2-integration branch (the fact that MoccaCal contains somewhat a copy of the FullCal UpdateService is a mistake that needs to be rectified at some time ...)
      https://github.com/xwiki-contrib/application-mocca-calendar/blob/MOCCACAL-24-fullcalendar-2-integration/application-mocca-calendar-ui/src/main/resources/MoccaCalendar/UpdateService.xml
      and the "calendarHelper.updateEvent" used in the eventDrop and eventResize options:
      https://github.com/xwiki-contrib/application-mocca-calendar/blob/MOCCACAL-24-fullcalendar-2-integration/application-mocca-calendar-ui/src/main/resources/MoccaCalendar/Macro.xml

        Issue Links

          Activity

          Hide
          Victor Rachieru added a comment -

          Fixed in c56d2a5abc63e764c62d1190b2be07cffc77c383

          Delta is now sent as a single parameter representing an object which in turn contains all the old variables which were needed (days, minutes, etc..).
          In order to keep backwards compatibility with possibly custom updateServices I've extracted deltaDays and deltaMinutes from the new delta parameter.

          Show
          Victor Rachieru added a comment - Fixed in c56d2a5abc63e764c62d1190b2be07cffc77c383 Delta is now sent as a single parameter representing an object which in turn contains all the old variables which were needed (days, minutes, etc..). In order to keep backwards compatibility with possibly custom updateServices I've extracted deltaDays and deltaMinutes from the new delta parameter.

            People

            • Assignee:
              Victor Rachieru
              Reporter:
              Clemens Robbenhaar
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Date of First Response: