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

Clicking the "Go to parent Folder" button takes me to the root folder #319

Closed
2 tasks done
ShortBusKing opened this issue May 3, 2018 · 2 comments
Closed
2 tasks done

Comments

@ShortBusKing
Copy link
Contributor

I use the following server-side connector (check one):

  • ASP.NET Core connector by sinanbozkus

My familiarity with the project is as follows (check one):

  • I am an active contributor to the project.

When clicking the "Go to parent Folder" button, it takes me to the root folder. Could this be a bug with the ASP.Net Core connector or is this something the javascript side should check for?

Example:
If I'm in the current working folder "/d/subfolder1/", the parent button will take me to the root instead of "/d".

The root cause is because the model.currentPath() returns 'd/subfolder1', while the code looks for two slashes. Since there is only one, the return string will be empty with a added "/" to indicate the root folder.

                this.navLevelUp = function() {
                    debugger;
                    var parentFolder = model.previewFile() ?
                        getDirname(model.previewModel.rdo().id) :
                        getParentDirname(model.currentPath() + '/');  <!--- the correct path is returned when adding a "/" -->

                    if (model.previewFile()) {
                        model.previewFile(false);
                    }

                    if (parentFolder !== model.currentPath()) {
                        model.itemsModel.loadDataList(parentFolder);
                    }
                };

Thanks for your time.

@psolom
Copy link
Owner

psolom commented May 4, 2018

Oh, this is exactly what I was talking about, when mentioned that absence of leading slash in path may my be the cause of implicit issues. You would better to prepend paths with leading slashes in all responses of the connector to avoid such surprises. Is this a problem? Could this be a problem?

ShortBusKing added a commit to ShortBusKing/RichFilemanager that referenced this issue May 4, 2018
Fixed psolom#319 Clicking the "Go to parent Folder" button takes me to the root folder
Reverted summary code 
Some cleanup
@ShortBusKing
Copy link
Contributor Author

See Pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants