Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

variable scoping for devtools/extensionManagerService sorting #1432

Open
wants to merge 1 commit into
base: stable
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions system/services/devtools/ExtensionManagerService.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -98,36 +98,36 @@ component {
}

private array function _sortExtensions( required array extensions ) {
var extensionCount = extensions.len();
var extensionCount = Len( arguments.extensions );
var swapped = false;

do {
swapped = false;
for( var i=1; i<=extensionCount-1; i++ ) {
var extA = extensions[ i ];
var extB = extensions[ i+1 ];
var extA = arguments.extensions[ i ];
var extB = arguments.extensions[ i+1 ];

if ( extA.dependsOn.len() ) {
for( var n=i+1; n<=extensionCount; n++ ) {
var extC = extensions[ n ];
var extC = arguments.extensions[ n ];

if ( extA.dependsOn.findNoCase( extC.id ) ) {
arrayDeleteAt(extensions, n);
arrayInsertAt(extensions, i, extC);
arrayDeleteAt(arguments.extensions, n);
arrayInsertAt(arguments.extensions, i, extC);
swapped = true;
break;
}
}
} else if ( extA.id > extB.id && !extB.dependsOn.findNoCase( extA.id ) ) {
var tmp = extB;
extensions[ i+1 ] = extA;
extensions[ i ] = tmp;
arguments.extensions[ i+1 ] = extA;
arguments.extensions[ i ] = tmp;
swapped = true;
}
}
} while( swapped );

return extensions;
return arguments.extensions;
}

private boolean function _isExtensionManifest( required string manifestPath, required string extensionsDir ) {
Expand Down
Loading