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

        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
        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/#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
        Henry Saputra added a comment -

        +1 LGTM

        Show
        Henry Saputra added a comment - +1 LGTM
        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
        Hide
        Ryan Baxter added a comment -

        revision 1298423

        Show
        Ryan Baxter added a comment - revision 1298423
        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.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development