PUBLIC - Liferay Portal Community Edition
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-16422

MVCPortlet callActionMethod won't handle last action in list unless the list ends with a comma

    Details

    • Liferay Contributor's Agreement:
      Accept
    • Similar Issues:
      Show 5 results 

      Description

      com.liferay.util.bridges.mvc.ActionCommandCache.getActionCommandChain() parses the list of Actions. If the list doesn't end with a comma, the last Action in the list is ignored.

      1. ActionCommandCache.java
        4 kB
        marco weiland
      2. LPS-16422-build-69404.patch
        2 kB
        marco weiland

        Activity

        Hide
        Deb Troxel added a comment -

        This issue is a backlog candidate for the 100 PaperCuts program. Please consider participating! See http://liferay.com/community/100-papercuts

        Show
        Deb Troxel added a comment - This issue is a backlog candidate for the 100 PaperCuts program. Please consider participating! See http://liferay.com/community/100-papercuts
        Show
        Deb Troxel added a comment - See discussion at http://www.liferay.com/community/forums/-/message_boards/message/8188060
        Hide
        marco weiland added a comment -

        imho we can fix that problem by replacing getActionComandChain method with this code:

        public List<ActionCommand> getActionCommandChain(
        String actionCommandChain) {

        List<ActionCommand> actionCommands = _actionCommandChainCache.get(
        actionCommandChain);

        if (actionCommands != null)

        { return actionCommands; }

        else

        { actionCommands = new ArrayList<ActionCommand>(); }

        for ( String commandString : actionCommandChain.split(CharPool.COMMA+"
        s*")){

        ActionCommand actionCommand = getActionCommand(commandString);

        if (actionCommand != EMPTY)

        { actionCommands.add(actionCommand); }

        else {
        if (_log.isWarnEnabled())

        { _log.warn( "Unable to find ActionCommand " + actionCommandChain); }

        }
        }

        _actionCommandChainCache.put(actionCommandChain, actionCommands);

        return actionCommands;
        }

        Show
        marco weiland added a comment - imho we can fix that problem by replacing getActionComandChain method with this code: public List<ActionCommand> getActionCommandChain( String actionCommandChain) { List<ActionCommand> actionCommands = _actionCommandChainCache.get( actionCommandChain); if (actionCommands != null) { return actionCommands; } else { actionCommands = new ArrayList<ActionCommand>(); } for ( String commandString : actionCommandChain.split(CharPool.COMMA+" s*")){ ActionCommand actionCommand = getActionCommand(commandString); if (actionCommand != EMPTY) { actionCommands.add(actionCommand); } else { if (_log.isWarnEnabled()) { _log.warn( "Unable to find ActionCommand " + actionCommandChain); } } } _actionCommandChainCache.put(actionCommandChain, actionCommands); return actionCommands; }
        Hide
        marco weiland added a comment -

        patch

        Show
        marco weiland added a comment - patch
        Hide
        marco weiland added a comment -

        svn patch

        Show
        marco weiland added a comment - svn patch
        Hide
        Cynthia Wilburn (Inactive) added a comment -

        Hi Deb - Was the provided patch a solution to the issue report? Thanks for your help!

        Show
        Cynthia Wilburn (Inactive) added a comment - Hi Deb - Was the provided patch a solution to the issue report? Thanks for your help!
        Hide
        Deb Troxel added a comment -

        Hi Cynthia,
        Yes, Marco's patch resolves the issue.

        Show
        Deb Troxel added a comment - Hi Cynthia, Yes, Marco's patch resolves the issue.

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Days since last comment:
              3 years, 31 weeks, 2 days ago

              Development

                Structure Helper Panel