Jump to content
X2Community Forums

[Solved] Error in Visual Process Display Module


Recommended Posts

Hi Raymond,

 

I'm working in the process module, and I'm running into an permission's error when I try to drag and drop an opportunity to a stage above stage 9 in the list. I'm able to move it freely in all stages up to and including 9, then attempting to move it beyond that comes up with a permissions error. 

 

I'm able to manually change the stage in the opportunity to a stage number above 9 in the opportunity record. Once manually set to stage 10 or higher, I can freely move it around in stages 10+, however I can't move it back down to stage 9 or below.

 

If I change the order of the stages in editing the process, say swapping stages 9 and 10, I'm able to move to the new stage 9 but not the the new stage 10.

 

I'm using the default web admin user with global permissions. None of the stages have any special user permissions on it. 

 

Error message on screen is: You do not have permission to perform that stage change.

 

I'll investigate further, but any assistance you may provide in rectifying this error would be appreciated. If you're able to come up with a bug fix before I am, can you please let me know the Git commit number so I can apply it manually in my system?

 

Warmest regards, 

 

Andrew

 

Edit: Added more information

Link to post
Share on other sites

Hello Andrew,

 

I've done a bit of digging and believe this issue is due to the fact that Array.sort() in JavaScript orders the elements in lexicographical order, according to the converted Unicode string (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort). Because of this, when trying to order the two stage numbers to move the record between, the sort could fail. For example, as integers, 5 "11", since "1" is before "5".

 

Please update the _checkPermission function in protected/modules/workflow/assets/js/DragAndDropViewManager.js as follows:

    //var stageRange = [stageA, stageB].sort ();
    if (stageA <= stageB)
        var stageRange = [stageA, stageB];
    else
        var stageRange = [stageB, stageA];

    hasPermission = auxlib.reduce (function (a, B) { return a & b; }, 
        this.stagePermissions.slice (stageRange[0] - 1, stageRange[1]));

Then remove the compiled assets in assets/* before refreshing the page.

 

Raymond

Link to post
Share on other sites
  • 2 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...