Shindig
  1. Shindig
  2. SHINDIG-1398

Shindig feature has Javascript error in setUserPref

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.0.0
    • Fix Version/s: None
    • Component/s: Javascript
    • Labels:
      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];

        Activity

          People

          • Assignee:
            Unassigned
            Reporter:
            Damian Biollo
          • Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:

              Development