Uploaded image for project: 'Shindig'
  1. Shindig
  2. SHINDIG-1398

Shindig feature has Javascript error in setUserPref

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.0.0
    • None
    • Javascript
    • None

    Description

      This can be reproduced very easily. Try the sample container, pointing to the Pixies Lab TODO list.
      (http://localhost:8080/samplecontainer/samplecontainer.html with "Displaying gadget" = http://www.labpixies.com/campaigns/todo/todo.xml)
      Then, with Firebug open, simply add a new TODO item.

      You will see a JS error in the following code from shindig-container.js (from the shindig-container feature).
      It happens on the line "this.userPrefs[...] = ... (see code below).

      The GadgetService doesn't have a userPrefs member. Instead, it should be calling the function on the gadget.

      shindig.IfrGadgetService.prototype.setUserPref = function(editToken, name,
      value) {
      var id = shindig.container.gadgetService.getGadgetIdFromModuleId(this.f);
      var gadget = shindig.container.getGadget(id);
      for (var i = 1, j = arguments.length; i < j; i += 2)

      { this.userPrefs[arguments[i]].value = arguments[i + 1]; }

      gadget.saveUserPrefs();
      };

      Changing the line inside the loop to this fixes the problem:
      gadget.userPrefs[arguments[i]].value = arguments[i + 1];

      Attachments

        Activity

          People

            Unassigned Unassigned
            damian.biollo Damian Biollo
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: