Shindig
  1. Shindig
  2. SHINDIG-1723

runAction function in action_container.js receives an empty array when it calls the registry.getGadgetSites instead of "undefined"

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.5.0-beta1
    • Fix Version/s: 2.5.0-beta2
    • Component/s: Javascript
    • Labels:
      None

      Description

      runAction function receives an empty array when it calls the registry.getGadgetSites instead of "undefined", which is what it receives when gadget loading works in earlier builds. Therefore, the first section in "if (!gadgetSites)" below doesn't get run and instead it incorrectly goes to the "else". .getGadgetSites appears to now always return an array and it will be empty if there aren't any sites instead of "undefined" like in the past.

      runAction: function(actionId, opt_selection) {
      var action = registry.getItemById(actionId);
      if (action) {
      // if gadget site has not been registered yet
      // the gadget needs to be rendered
      var gadgetSites = registry.getGadgetSites(actionId);
      if (!gadgetSites) {
      var gadgetUrl = registry.getUrl(actionId);
      pendingActions[actionId] =

      { selection: opt_selection || container_.selection.getSelection() }

      ;
      // set optional params
      ......
      },

        Activity

        Ryan Baxter made changes -
        Fix Version/s 2.5.0-beta2 [ 12321670 ]
        Fix Version/s 2.5.0-beta1 [ 12315324 ]
        Paul Lindner made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Ryan Baxter made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.5.0 [ 12315324 ]
        Resolution Fixed [ 1 ]
        Yao Zhang made changes -
        Attachment SHINDIG-1723.patch [ 12517517 ]
        Yao Zhang made changes -
        Summary navigateGadgetHandler never gets called because the runAction function in action_container.js receives an empty array when it calls the registry.getGadgetSites instead of "undefined", runAction function in action_container.js receives an empty array when it calls the registry.getGadgetSites instead of "undefined"
        Description When trying to load gadgets, the navigateGadgetHandler never gets called because the runAction function receives an empty array when it calls the registry.getGadgetSites instead of "undefined", which is what it receives when gadget loading works in earlier builds. Therefore, the first section in "if (!gadgetSites)" below doesn't get run and instead it incorrectly goes to the "else". .getGadgetSites appears to now always return an array and it will be empty if there aren't any sites instead of "undefined" like in the past.

        runAction: function(actionId, opt_selection) {
        var action = registry.getItemById(actionId);
        if (action) {
        // if gadget site has not been registered yet
        // the gadget needs to be rendered
        var gadgetSites = registry.getGadgetSites(actionId);
        if (!gadgetSites) {
        var gadgetUrl = registry.getUrl(actionId);
        pendingActions[actionId] = {
        selection: opt_selection || container_.selection.getSelection()
        };
        // set optional params
        ......
        },
        runAction function receives an empty array when it calls the registry.getGadgetSites instead of "undefined", which is what it receives when gadget loading works in earlier builds. Therefore, the first section in "if (!gadgetSites)" below doesn't get run and instead it incorrectly goes to the "else". .getGadgetSites appears to now always return an array and it will be empty if there aren't any sites instead of "undefined" like in the past.

        runAction: function(actionId, opt_selection) {
        var action = registry.getItemById(actionId);
        if (action) {
        // if gadget site has not been registered yet
        // the gadget needs to be rendered
        var gadgetSites = registry.getGadgetSites(actionId);
        if (!gadgetSites) {
        var gadgetUrl = registry.getUrl(actionId);
        pendingActions[actionId] = {
        selection: opt_selection || container_.selection.getSelection()
        };
        // set optional params
        ......
        },
        Yao Zhang made changes -
        Field Original Value New Value
        Description When trying to load inline gadgets, the navigateGadgetHandler never gets called because the runAction function receives an empty array when it calls the registry.getGadgetSites instead of "undefined", which is what it receives when gadget loading works in earlier builds. Therefore, the first section in "if (!gadgetSites)" below doesn't get run and instead it incorrectly goes to the "else". .getGadgetSites appears to now always return an array and it will be empty if there aren't any sites instead of "undefined" like in the past.

        runAction: function(actionId, opt_selection) {
        var action = registry.getItemById(actionId);
        if (action) {
        // if gadget site has not been registered yet
        // the gadget needs to be rendered
        var gadgetSites = registry.getGadgetSites(actionId);
        if (!gadgetSites) {
        var gadgetUrl = registry.getUrl(actionId);
        pendingActions[actionId] = {
        selection: opt_selection || container_.selection.getSelection()
        };
        // set optional params
        ......
        },
        When trying to load gadgets, the navigateGadgetHandler never gets called because the runAction function receives an empty array when it calls the registry.getGadgetSites instead of "undefined", which is what it receives when gadget loading works in earlier builds. Therefore, the first section in "if (!gadgetSites)" below doesn't get run and instead it incorrectly goes to the "else". .getGadgetSites appears to now always return an array and it will be empty if there aren't any sites instead of "undefined" like in the past.

        runAction: function(actionId, opt_selection) {
        var action = registry.getItemById(actionId);
        if (action) {
        // if gadget site has not been registered yet
        // the gadget needs to be rendered
        var gadgetSites = registry.getGadgetSites(actionId);
        if (!gadgetSites) {
        var gadgetUrl = registry.getUrl(actionId);
        pendingActions[actionId] = {
        selection: opt_selection || container_.selection.getSelection()
        };
        // set optional params
        ......
        },
        Yao Zhang created issue -

          People

          • Assignee:
            Unassigned
            Reporter:
            Yao Zhang
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development