WordPress.org

Ready to get started?Download WordPress

Forums

Google Calendar Widget
JavaScript error in Wiki.js apply() (1 post)

  1. Steve
    Member
    Posted 1 year ago #

    I've just installed Google Calendar Widget on my WordPress server (wp.a2nipswich.org.uk). It displayed the list of events ok, but when I clicked on an event to get the full details, nothing happened.

    Browser is Chrome 22.0.1229.79 m, although I also tried it with IE 8 and had the same problem.

    Digging down with the Chrome Developer tools, I discovered that a JavaScript exception was occurring in apply() in Wiki.js (line 191): undefined method 'rex'.

    Digging further, it turned out that there was a problem with the loop "for (var i in rules)": it worked ok if 'rules' had multiple elements, i went 0 1 2 3 etc; however if 'rules' had only one element, i was set to "toJSON" (rather than 0) which meant that rules[i] is undefined.

    This may be a bug in Chrome, I haven't had time to debug on other browsers.

    I tried to reproduce the problem with the example calendars at http://notions.okuda.ca/wordpress-plugins/google-calendar-widget/, however these don't have enough data (location, description) to trigger the problem - str is blank when apply() is called.

    I've found a simple fix which seems to get round the problem - change the for loop to:

    for (var i = 0; i < rules.length; i++) {

    http://wordpress.org/extend/plugins/google-calendar-widget/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic