View Issue Details

IDProjectCategoryView StatusLast Update
0019283MediaMonkey 5Extensions frameworkpublic2022-07-26 17:48
Reporterzvezdan Assigned To 
PrioritynoneSeverityminorReproducibilityalways
Status feedbackResolutionopen 
Summary0019283: navUtils.getFocusedNode() in 'focuschange' event handler returns wrong dataSource.path
DescriptionnavUtils.getFocusedNode() in 'focuschange' event handler returns wrong dataSource.path with the drive letter only, even for sub-folders, e.g. instead of 'f:\\Temp\\' it returns 'F:-'
Steps To ReproduceHere is the code:
    app.listen(window.currentTabControl.mediatree.controlClass.dataSource, 'focuschange', function (e) {
        var oSelNode = navUtils.getFocusedNode();
        console.log('oSelNode: ' + (oSelNode ? oSelNode.handlerID + ', title: "' + oSelNode.title + '", path: "' + oSelNode.dataSource.path + '", nodePath: ' + oSelNode.nodePath : '') + ', arg: ', (e), (oSelNode));
    });
TagsNo tags attached.
Fixed in build

Relationships

related to 0019270 closedLudek app.filesystem.getFolderOfPathAsync(...).path is sometimes wrong 
related to 0019282 feedbackzvezdan navUtils.getFocusedNode().dataSource.path returns paths with the '-' appended 

Activities

Ludek

2022-07-26 15:34

developer   ~0068916

Similarly like in case of 0019282 I am unable to replicate, works fine for me even after reverting of 0019270
image.png (13,439 bytes)   
image.png (13,439 bytes)   

Ludek

2022-07-26 15:36

developer   ~0068917

Does this happen on clean install with all scripts disabled?

zvezdan

2022-07-26 16:06

updater   ~0068921

You are right, this doesn't happen on a clean install. But it is enough to create just one script with the init.js containing the mentioned lines and it will happen. The 'focuschange' event handler is doing it somehow. I didn't try with the alert dialog box, you should test it with the DevTools / Console opened.

The test code in the related issue is also tested in DevTools.

Ludek

2022-07-26 17:10

developer   ~0068925

OK, so I will definetly need the sample script to be able to replicate the issue.

zvezdan

2022-07-26 17:20

updater   ~0068927

It seems it happens only with folders from Location folder, not from the Folders branch.
Test.mmip (541 bytes)

zvezdan

2022-07-26 17:42

updater   ~0068928

And here is another approach to the same problem, it has this in init.js:
nodeHandlers.dbfolder.menuAddons = nodeHandlers.dbfolder.menuAddons || [];
nodeHandlers.dbfolder.menuAddons.push(function (oCurrNode) {
    var sFolder = oCurrNode.dataSource.path;
    console.log('dbfolder: "' + sFolder + '"', (oCurrNode));
    return [];
});

nodeHandlers.folder.menuAddons = nodeHandlers.folder.menuAddons || [];
nodeHandlers.folder.menuAddons.push(function (oCurrNode) {
    var sFolder = oCurrNode.dataSource.path;
    console.log('folder: "' + sFolder + '"', (oCurrNode));
    return [];
});

nodeHandlers.drive.menuAddons = nodeHandlers.drive.menuAddons || [];
nodeHandlers.drive.menuAddons.push(async function (oCurrNode) {
    var sFolder = oCurrNode.dataSource.path;
    console.log('drive: "' + sFolder + '"', (oCurrNode));
    return [];
});
Test2.mmip (519 bytes)

zvezdan

2022-07-26 17:48

updater   ~0068929

Only nodes from the Location branch are affected with the second script as well.