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 ]
        Hide
        Paul Lindner added a comment -

        part of 2.5.0-beta1 release.

        Show
        Paul Lindner added a comment - part of 2.5.0-beta1 release.
        Ryan Baxter made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.5.0 [ 12315324 ]
        Resolution Fixed [ 1 ]
        Hide
        Ryan Baxter added a comment -

        revision 1298423

        Show
        Ryan Baxter added a comment - revision 1298423
        Hide
        jiraposter@reviews.apache.org added a comment -

        -----------------------------------------------------------
        This is an automatically generated e-mail. To reply, visit:
        https://reviews.apache.org/r/4216/#review5728
        -----------------------------------------------------------

        Ship it!

        Thanks for the patch! committed with revision 1298423.

        • li

        On 2012-03-07 06:44:46, Yao Zhang wrote:

        -----------------------------------------------------------

        This is an automatically generated e-mail. To reply, visit:

        https://reviews.apache.org/r/4216/

        -----------------------------------------------------------

        (Updated 2012-03-07 06:44:46)

        Review request for shindig and Henry Saputra.

        Summary

        -------

        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] = { bq. selection: opt_selection || container_.selection.getSelection() bq. };

        // set optional params

        ......

        },

        This addresses bug SHINDIG-1723.

        https://issues.apache.org/jira/browse/SHINDIG-1723

        Diffs

        -----

        http://svn.apache.org/repos/asf/shindig/trunk/features/src/main/javascript/features/actions/actions_container.js 1297846

        Diff: https://reviews.apache.org/r/4216/diff

        Testing

        -------

        Done.

        Thanks,

        Yao

        Show
        jiraposter@reviews.apache.org added a comment - ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/4216/#review5728 ----------------------------------------------------------- Ship it! Thanks for the patch! committed with revision 1298423. li On 2012-03-07 06:44:46, Yao Zhang wrote: ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/4216/ ----------------------------------------------------------- (Updated 2012-03-07 06:44:46) Review request for shindig and Henry Saputra. Summary ------- 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] = { bq. selection: opt_selection || container_.selection.getSelection() bq. }; // set optional params ...... }, This addresses bug SHINDIG-1723 . https://issues.apache.org/jira/browse/SHINDIG-1723 Diffs ----- http://svn.apache.org/repos/asf/shindig/trunk/features/src/main/javascript/features/actions/actions_container.js 1297846 Diff: https://reviews.apache.org/r/4216/diff Testing ------- Done. Thanks, Yao
        li xu committed 1298423 (1 file)
        Reviews: none

        SHINDIG-1723 | commit patch for Yao Zhang | check empty array insteadof "undefined" for registry.getGadgetSites in actions_container.js

        Hide
        Henry Saputra added a comment -

        +1 LGTM

        Show
        Henry Saputra added a comment - +1 LGTM
        Yao Zhang made changes -
        Attachment SHINDIG-1723.patch [ 12517517 ]
        Hide
        jiraposter@reviews.apache.org added a comment -

        -----------------------------------------------------------
        This is an automatically generated e-mail. To reply, visit:
        https://reviews.apache.org/r/4216/#review5685
        -----------------------------------------------------------

        Please attach your patch to the JIRA and grant apache license.

        • Dan

        On 2012-03-07 06:44:46, Yao Zhang wrote:

        -----------------------------------------------------------

        This is an automatically generated e-mail. To reply, visit:

        https://reviews.apache.org/r/4216/

        -----------------------------------------------------------

        (Updated 2012-03-07 06:44:46)

        Review request for shindig and Henry Saputra.

        Summary

        -------

        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] = { bq. selection: opt_selection || container_.selection.getSelection() bq. };

        // set optional params

        ......

        },

        This addresses bug SHINDIG-1723.

        https://issues.apache.org/jira/browse/SHINDIG-1723

        Diffs

        -----

        http://svn.apache.org/repos/asf/shindig/trunk/features/src/main/javascript/features/actions/actions_container.js 1297846

        Diff: https://reviews.apache.org/r/4216/diff

        Testing

        -------

        Done.

        Thanks,

        Yao

        Show
        jiraposter@reviews.apache.org added a comment - ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/4216/#review5685 ----------------------------------------------------------- Please attach your patch to the JIRA and grant apache license. Dan On 2012-03-07 06:44:46, Yao Zhang wrote: ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/4216/ ----------------------------------------------------------- (Updated 2012-03-07 06:44:46) Review request for shindig and Henry Saputra. Summary ------- 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] = { bq. selection: opt_selection || container_.selection.getSelection() bq. }; // set optional params ...... }, This addresses bug SHINDIG-1723 . https://issues.apache.org/jira/browse/SHINDIG-1723 Diffs ----- http://svn.apache.org/repos/asf/shindig/trunk/features/src/main/javascript/features/actions/actions_container.js 1297846 Diff: https://reviews.apache.org/r/4216/diff Testing ------- Done. Thanks, Yao
        Hide
        jiraposter@reviews.apache.org added a comment -

        -----------------------------------------------------------
        This is an automatically generated e-mail. To reply, visit:
        https://reviews.apache.org/r/4216/#review5684
        -----------------------------------------------------------

        Ship it!

        LGTM, nice catch.

        • Dan

        On 2012-03-07 06:44:46, Yao Zhang wrote:

        -----------------------------------------------------------

        This is an automatically generated e-mail. To reply, visit:

        https://reviews.apache.org/r/4216/

        -----------------------------------------------------------

        (Updated 2012-03-07 06:44:46)

        Review request for shindig and Henry Saputra.

        Summary

        -------

        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] = { bq. selection: opt_selection || container_.selection.getSelection() bq. };

        // set optional params

        ......

        },

        This addresses bug SHINDIG-1723.

        https://issues.apache.org/jira/browse/SHINDIG-1723

        Diffs

        -----

        http://svn.apache.org/repos/asf/shindig/trunk/features/src/main/javascript/features/actions/actions_container.js 1297846

        Diff: https://reviews.apache.org/r/4216/diff

        Testing

        -------

        Done.

        Thanks,

        Yao

        Show
        jiraposter@reviews.apache.org added a comment - ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/4216/#review5684 ----------------------------------------------------------- Ship it! LGTM, nice catch. Dan On 2012-03-07 06:44:46, Yao Zhang wrote: ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/4216/ ----------------------------------------------------------- (Updated 2012-03-07 06:44:46) Review request for shindig and Henry Saputra. Summary ------- 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] = { bq. selection: opt_selection || container_.selection.getSelection() bq. }; // set optional params ...... }, This addresses bug SHINDIG-1723 . https://issues.apache.org/jira/browse/SHINDIG-1723 Diffs ----- http://svn.apache.org/repos/asf/shindig/trunk/features/src/main/javascript/features/actions/actions_container.js 1297846 Diff: https://reviews.apache.org/r/4216/diff Testing ------- Done. Thanks, Yao
        Hide
        jiraposter@reviews.apache.org added a comment -

        -----------------------------------------------------------
        This is an automatically generated e-mail. To reply, visit:
        https://reviews.apache.org/r/4216/
        -----------------------------------------------------------

        Review request for shindig and Henry Saputra.

        Summary
        -------

        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
        ......
        },

        This addresses bug SHINDIG-1723.
        https://issues.apache.org/jira/browse/SHINDIG-1723

        Diffs


        http://svn.apache.org/repos/asf/shindig/trunk/features/src/main/javascript/features/actions/actions_container.js 1297846

        Diff: https://reviews.apache.org/r/4216/diff

        Testing
        -------

        Done.

        Thanks,

        Yao

        Show
        jiraposter@reviews.apache.org added a comment - ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/4216/ ----------------------------------------------------------- Review request for shindig and Henry Saputra. Summary ------- 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 ...... }, This addresses bug SHINDIG-1723 . https://issues.apache.org/jira/browse/SHINDIG-1723 Diffs http://svn.apache.org/repos/asf/shindig/trunk/features/src/main/javascript/features/actions/actions_container.js 1297846 Diff: https://reviews.apache.org/r/4216/diff Testing ------- Done. Thanks, Yao
        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