[ACE-3783] onActionSimpleRepoAction JS function does not allow for asynchronous action execution Created: 10-Feb-15  Updated: 01-Dec-16  Resolved: 03-Dec-15

Status: Closed
Project: Alfresco One Platform
Component/s: Document Library
Affects Version/s: 4.2
Fix Version/s: Community Edition 201512 EA, 5.1

Type: Bug Priority: Major
Reporter: Charlie Halford (Inactive) Assignee: Closed Issues
Resolution: Fixed Votes: 0
Labels: triaged
Remaining Estimate: 0 minutes
Time Spent: 1 week, 1 hour
Original Estimate: Not Specified

Build Location: https://nightlybuilds.alfresco.com/Enterprise-5.1/5.1/LATEST/


The onActionSimpleRepoAction function in share/components/documentlibrary/actions.js defines the wrong webscript URL, if the calling action wishes to execute asynchronously.

The ActionQueuePost webscript accepts a webscript parameters, async, which ensures that the action being fired is executed asynchronously. The only way to add this webscript parameter from onActionSimpleRepoAction is to add an additonal URI template variable to the webscript name.

Line 1042 in actions.js should have:
name: "actionQueue"
replaced with:
name: "actionQueue?{async}

With this change, an action defined in share-config-custom.xml can include an async parameter, and have that parameter passed through to the Action Queue webscript, enabling asynchronous execution.

Comment by Kevin Roast [X] (Inactive) [ 10-Feb-15 ]

Thank you for raising the issue and supplying the suggested fix.

Comment by Alex Mukha [ 03-Aug-15 ]

I suppose the solution should be changed a little.
The parameter should be placed in the URL, the Alfresco.module.DoclibActions.genericAction already has a mechanism to place URL parameters and it looks for queryString configuration. This configuration can be added to the action config, for example "async" param:

         <!-- Approve simple workflow -->
         <action id="document-approve" type="javascript" label="{jsNode.properties.app_approveStep}">
            <param name="function">onActionSimpleRepoAction</param>
            <!-- Additional parameters for onRepoAction function  -->
            <param name="async">true</param>
            <param name="action">accept-simpleworkflow</param>
            <param name="successMessage">message.simple-workflow.approved</param>
            <param name="failureMessage">message.simple-workflow.failure</param>
            <!-- aspect check, property != null check, action name = property value -->

The configuration will be passed to Alfresco.doclib.Actions.onActionSimpleRepoAction, which needs modifications. Please, review the changes in r109473.

Comment by Rodica Sutu [ 29-Oct-15 ]

Could someone please advice how to test this issue?

Generated at Thu Jul 09 08:39:58 BST 2020 using JIRA 7.6.3#76005-sha1:8a4e38d34af948780dbf52044e7aafb13a7cae58.